Skip to main content

Full text of "dec :: Books :: 101 BASIC Computer Games Mar75"

See other formats


101 BASIC Computer Games 



Digital Equipment Corporation 
Maynard, Massachusetts 



Additional copies of 101 BASIC Computer Games 
are available for $7.50 plus 50 cents postage 
and handling from: 

Software Distribution Center 
Digital Equipment Corporation 
Maynard, Massachusetts 01754 

Write for discount schedule on quantities over 30. 

Two supplemental guides are available for use 
with this book. They are: 

Understanding Mathematics and Logic Using 
BASIC Computer Games , $4.50. Grades 7-12. 

Getting Started in Classroom Computing , 
$3.00. Grades 2-7. 



1st Printing — July 1973 
2nd Printing — April 1974 
3rd Printing — March 1975 



Copyright © 1975 by: 

Digital Equipment Corporation 
Maynard , Massachusetts 01754 



Contents 



Game 

ACEYDU 

AMAZIN 

ANIMAL 

AWARI 

BAGLES 

BANNER 

BASBAL 

BASKET 

BATNUM 

BATTLE 

BINGO 

BLKJAC 

BLKJAK 

BOAT 

BOMBER 

BOUNCE 

BOWL 

BOXING 

BUG 

BULCOW 

BULEYE 

BULL 

BUNNY 

BUZZWD 

CALNDR 

CAN -AM 

CHANGE 

CHECKR 

CHEMST 

CHIEF 

CHOMP 

CIVILW 

CRAPS 

CUBE 

DIAMND 

DICE 

DIGITS 

DOGS 

EVEN 

EVEN1 
FIPFOP 



Brief Description 



Page 



a bug 

the computer 



Play acey-ducey with the computer 

Computer constructs a maze 

Computer guesses animals and learns new ones from you 

Ancient game of rotating beans in pits 

Guess a mystery 3-digit number by logic 

Prints any message on a large banner 

Baseball game 

Basketball game 

Match wits in a battle of numbers vs. the computer 

Decode a matrix to locate enemy battleship 

Computer prints your card and calls the numbers 

Blackjack (very comprehensive), Las Vegas rules 

Blackjack (standard game) 

Destroy a gunboat from your submarine 

Fly World War II bombing missions 

Plot a bouncing ball 

Bowling at the neighborhood lanes 

3 -round Olympic boxing match 

Roll dice vs. the computer to draw 

Guess a mystery 5-digit number vs. 

Throw darts 

You're the matador in a championship bullfight 

Computer drawing of the Playboy bunny 

Compose your speeches with the latest buzzwords 

Calendar for any year 

Drive a Group 7 car in a Can-Am road race 

Computer imitates a cashier 

Game of checkers 

Dilute kryptocyanic acid to make it harmless 

Silly arithmetic drill 

Eat a cookie avoiding the poison piece 

(2 or more players) 
Fight the Civil War 
Play craps (dice) , Las Vegas style 
Negotiate a 3-D cube avoiding hidden landmines 
Prints 1-page diamond patterns 
Summarizes dice rolls 

Computer tries to guess digits you select at random 
Penny arcade dog race 
Take objects from a pile — try to end with an even 

number 
Same as EVEN— computer improves its play 
Solitaire logic game — change a row of Xs to Os 



13 
15 
17 
19 
22 
24 
26 
29 
32 
34 
36 
39 
42 
43 
45 
47 
48 
50 
52 
55 
57 
59 
62 
63 
65 
67 
72 
73 
76 
77 
78 

80 
83 
85 
87 
89 
91 
93 
96 

98 
99 



FOOTBL 

FOTBAL 

FURS 

GOLF 

GOMOKO 

GUESS 

GUNNER 

GUNER1 

HANG 

HELLO 

HEX 

HI-LO 

HI-Q 

HMRABI 

HOCKEY 

HORSES 

HURKLE 

KINEMA 

KING 

LETTER 

LIFE 

LIFE-2 

LITQZ 

MATED 1 

MNOPLY 

MUGWMP 

NICOMA 

NIM 

NUMBER 

1CHECK 

ORBIT 

PIZZA 

POETRY 

POET 

POKER 

QUBIC 

QUEEN 

REVRSE 

ROCKET 

ROCKT1 

ROCKT2 

ROCKS P 

ROULET 

RUSROU 

SALVO 

SALVO 1 

SLOTS 

SNOOPY 

SPACWR 



Professional football (very comprehensive) 101 

High School football 104 

Trade furs with the white man 106 

Golf game — choose your clubs and swing 109 

Ancient board game of logic and strategy 111 

Guess a mystery number — computer gives you clues 113 

Fire a cannon at a stationary target 115 

Fire a cannon at a moving target 117 

Hangman word guessing game 118 

Computer becomes your friendly psychiatrist 120 

Hexapawn game 122 

Try to hit the mystery jackpot 124 

Try to remove all the pegs from a board 126 

Govern the ancient city-state of Sumeria 128 

Ice hockey vs. Cornell 130 

Of f -track betting on a horse race 133 

Find the Hurkle hiding on a 10x10 grid 135 

Drill in simple kinematics 137 

Govern a -modern island kingdom wisely 138 

Guess a mystery letter — computer gives you clues 141 

John Conway's Game of Life 14 3 

Competitive game of life (2 or more players) 146 

Children's literature quiz 150 
Children's arithmetic drill using pictures of dice 151 

Monopoly for 2 players 153 

Locate 4 Mugwumps hiding on a 10x10 grid 156 

Computer guesses number you think of 158 

Chinese game of Nim 160 

Silly number matching game 162 

Challenging game to remove checkers from a board 163 

Destroy an orbiting germ-laiden enemy spaceship 165. 

Deliver pizzas successfully 16.7. 

Computer composes poetry in 4-part harmony 169 

Computer composes random poetry 171 

Poker game 172 

3-dimensional tic-tac-toe 175 

Move a single chess queen vs. the computer 178 

Order a series of numbers by reversing 180 

Land an Apollo capsule on the moon 182 

Lunar landing from 500 feet (with plot) 185 

Very comprehensive lunar landing 186 

Game of rock, scissors, paper 188 

European roulette table 189 

Russian roulette 19 2 

Destroy an enemy fleet of ships 193 

Destroy 4 enemy outposts 19 6 

Slot machine (one -arm bandit) 19 8 

Pictures of Snoopy 200 

Comprehensive game of spacewar 201 



SPLAT 

STARS 

STOCK 

SYNONM 

TARGET 

3D PLOT 

TICTAC 

TOWER 

TRAIN 

TRAP 

23MTCH 

UGLY 

WAR 

WAR- 2 

WEKDAY 

WORD 

YAHTZE 

ZOOP 



Open a parachute at the last possible moment 205 

Guess a mystery number — stars give you clues 207 

Stock market simulation 209 

Word synonym drill 212 

Destroy a target in 3-D space — very tricky 214 

Plots families of curves — looks 3-dimensional 216 

Tic-tac-toe 218 

Towers of Hanoi puzzle 221 

Time-speed-distance quiz 223 

Trap a mystery number — computer gives you clues 224 

Game of 23 matches — try not to take the last one 226 

Silly profile plot of an ugly woman 228 

Card game of war 230 

Troop tactics in war 232 

Facts about your birthday 234 

Word guessing game 236 

Dice game of Yahtzee 238 

BASIC programmer's nightmare 243 



Appendices 



A 
B 
C 



Families of Games 

Game Diagrams 

Instructions to Game Authors 



247 
248 
249 




Preface 



This is not the first collection of computer games and simula- 
tions nor will it by any means be the last. However, in many 
ways it is unique. It is the first collection of games all 
in BASIC. It is also the only collection that contains both 
a complete listing and a sample run of each game along with a 
descriptive write-up. 

Educational Value of Games 

Educators have widely different opinions as to the educational 
value of games. There tends to be agreement that games are 
highly motivational and frequently very addictive. Most 
educators agree that games generally foster learning by dis- 
covery — i.e., the player doesn't sit down at the terminal with 
the purpose of learning a principle of logic but after playing 
BAGLES three or four times he most assuredly has learned some- 
thing about logic. Newton f s second law is probably the furthest 
thing from the mind of a person sitting down to play ROCKET. 
However, when the player finally lands his LEM successfully on 
the moon, the chances are very good that he has discovered 
something about gravity varying inversely with the mass of the 
LEM and the distance from the moon. 

The main objection to games as a learning tool seems to be the 
fact that it's largely unguided learning and potentially waste- 
ful of computer time. Art Leuhrmann of Dartmouth joked that 
some computer center directors might be willing to pay to not 
have the book sold on campus because of the computer time that 
would be burned up by playing the games; however, the educational 
value of games can be enormous - not only in their playing but 
in their creation* 

The majority of games submitted tend to simulate a sport, card 
or board game, a game of chance or something which already exists. 
Only a few games begin to use the logical and computational 
capabilities of the computer to come up with something new and 
truly unique. Some that do are STARES, BULCOW, ROCKET, and 
LIFE-2. 

Certain games are, of course, more popular with game authors that 
others. There were no less than ten versions of NIM submitted, 
nine versions each of HORSES (Horse Race) and TICTAC (Tic-Tac-Toe) , 
and eight versions of CRAPS. Other popular ones were simulations 
of baseball, basketball, football, blackjack, and hangman. 



Families of Games 

A. word about the title of the book. The astute, quantitatively- 
oriented reader might notice that there seem to be more than 
101 games in the book. in fact, there are 108 individual games; 
7 are different versions of another game. There are 101 separate 
write-ups; thus, the title of the book. 

Perhaps it is a disease of using the computer or perhaps it is 
just a compulsion of man that he must categorize things. The 
games in this book could be categorized by level of difficulty 
as is often the case in collections of puzzles. They could 
also be categorized in an educational sense, for example, those 
that could be used to teach logic principles, those that foster 
learing by discovery, those that require the user to solve an 
algebra problem, etc e 

In the first two groups, Number or Letter Guessing and Piles of 
Objects, you will probably get more enjoyment if you play the 
games in the numbered order as there is a definite sequential 
nature to their difficulty. In the other fourteen categories, 
the games may be played in any order; one does not generally 
build upon another except in a few cases. In particular, you 
should play : 

BAGLES before BULCOW 

HI-Q before lCHECK 

BATTLE before SALVO 

GUNNER before SUNERl 

ROCKET before R0CKT2 

HMRABI before KING 



Equipment to Play, Computer and Otherwise 

Most of the games in this book require no special knowledge, tools 
or equipment to play, except, of course, a BASIC-speaking computer. 
Four of the matrix games will probably be more enjoyable if you 
use a grid or quadrille paper to play. Unless you have a photo- 
graphic memory, QUBIC almost certainly requires a diagram. There 
is a page included as Appendix B which contains some supplemental 
diagrams; you may wish to reproduce it if you become addicted to 
the games on it. 

With few exceptions, the games all run in "standard" BASIC. Any 
exceptions are noted in the write-ups under the heading, "Computer 
Limitations." The major difference between various computer systems 
appears to be in the handling of alphabetic strings . On Digital 
systems a subscripted string variableV for example, A$ (8) or Cl$ (15) , 
refers to a variable in an array or matrix. Other BASIC compilers 
may not have string arrays. 

8 



On some systems, in particular, Digital's Edusystems 20, 25, and 50, 
strings are limited to 6 characters. Several strings may, or course, 
be combined in an array to permit longer than 6-letter words to be 
used. 

Many programs use the RANDOMIZE command to start the random number 
generator at a random point. Some BASIC compilers do not recognize 
RANDOMIZE and it must be removed in order for the program to run. 

Digital BASIC permits more than one statement on each program line. 
Statement separators on the line may be one of three characters — 
/ or : or A . 

Digital Equipment Corporation 
Maynard, Massachusetts 
July 1973 



ACKNOWLEDGEMENTS 



Rusty Whitney 

Oregon Museum of Science and Industry 

Portland, Oregon 

Bob Albrecht 

People's Computer Company 

Menlo Park, California 

Walt Koetke 
Lexington High School 
Lexington, Massachusetts 

Charles Lund 

The American School of the International Schools 

The Hague, Netherlands 

Mary C. Jones 
Southwest High School 
Fort Worth, Texas 

Victor Nahigian (student) 
Weston High School 
Weston, Massachusetts 

Keiwit Computation Center 
Dartmouth College 
Hanover, New Hampshire 

Education and DEC system- 10 Groups 
Digital Equipment Corporation 
Maynard, Massachusetts 



Illustrations courtesy of: 



MAD Magazine 

Scott, Foresman & Co. 

Bob Barner 

Creative Publications 

Peoples Press 

and several other sources. 



10 




The Games... 



11 



ACEYDU 



ACEY DUCEY CARD GAME 



Description 



This is a simulation of the Acey Ducey card game. In the 
game, the dealer (the computer) deals two cards face up. 
You have an option to bet or not to bet depending on whether 
or not you feel the next card dealt will have a value between 
the first two. 

Your initial money (Q) is set to $100; you may alter Statement 
170 if you want to start with more or less than $100. The 
game keeps going on until you lose all your money or interrupt 
the program. 



Program Author 

Bill Palmby 

Adlai E. Stevenson High School 

Prairie View, Illinois 60069 




13 



PROGRAM LISTING 



SAMl&E RUN- 



LlSTNH 

18 REM *** GAME OF flCEV-DUCEV WRITTEN BV BILL PALMBV 

20 REM *** ADLAI STEVENSON HIGH SCHOOL, PRAIRE VIEW, ILL 

30 REM +*+ TRANSLATED TO RSTS/'E BV DAVE AHL, DIGITAL 

100 RANDOMIZE 

101 PRINT "ACEV-DUCEV IS PLAYED IN THE FOLLOWING MANNER:" 

102 PRINT "THE DEALER (COMPUTER) DEALS TWO CARDS FACE UP. " 
163 PRINT "YOU HAVE THE OPTION TO BET OR NOT TO BET DEPENDING" 

104 PRINT "ON WHETHER OR NOT YOU FEEL THE NEXT CARD WILL HAVE" 

105 PRINT "A VALUE BETWEEN THE FIRST TWO. " 

106 PRINT "IF VOU DO NOT WANT TO BET, INPUT AS." 
110 PRINT 

168 N=188: 0=180 

190 PRINT "VOU NOW HAVE "Q "DOLLARS. " 

195 PRINT .' , . ■ 

200 GOTO 260 ' 

210 G=?Q+M - 

220 GOTO 190 

240 G=G-M 

250 GOTO 190 

260 PRINT "HERE ARE YOUR NEXT TWO CARDS. . . " 

270 A=INT'il4 + RND) + 2 

280 IF A<2 THEN 270 

290 IF A>14 THEN 27© 

300 B=INT<14*RND)+2 

310 IF B<2 THEN 200 

320 IF B>14 THEN 300 

330 IF A>=B THEN 270 

350 IF A<11 THEN 492 

360 IF A=ll THEN 420 

370 IF A=12 THEN 440 

380 IF A = 13 THEN 460 

390 IF A = 14 THEN 480 

400 PRINT A 

410 GOTO 500 

420 PRINT "JACK" 

430 GOTO 500 

440 PRINT "QUEEN" 

450 GOTO 500 

460 PRINT "KING" 

470 GOTO 500 

480 PRINT "ACE" 

500 IF B<11 THEN 550 

510 IF B=ll THEN 57© 

520 IF B=12 THEN 590 

530 IF B=13 THEN 618 

540 IF B=14 THEN 63© 

550 PRINT B 

560 GOTO 650 

578 PRINT "JACK" 

580 GOTO 650 

590 PRINT "QUEEN" 

600 GOTO 650 

610 PRINT "KING" 

620 GOTO 650 

630 PRINT "ACE" 

650 PRINT 

668 INPUT "WHAT IS YOUR BET".; M * 

670 IF MOO THEN 688 

675 PR I NT " CH I CKEN ! ! " : PR I NT 

677 GOTO 260 

680 IF MOQ THEN 73© 

6 9 P R I N T " S R R V , M V F R I E N D , B U T V U BET T 00 M U C H " 

700 PRINT "VOU HAVE ONLY" Q "DOLLARS TO BET. " 

710 GOTO 650 

730 C=INT<14*RND> + 2 ' .■'-.' 

740 IF C<2 THEN 730 v . ' " " " 

750 IF C>14 THEN 738 : :■:' 

768 IF C<11 THEN 810 . V ,.;■-,- 

770 IF C=ll THEN 838 - 

780 IF C=12 THEN 850 - 

790 IF C=13 THEN 870 

800 IF 014 THEN 890 

810 PRINT C : 

820 GOTO 910 • 

830 PRINT "JACK" . . '' 

840 GOTO 918 

850 PRINT "QUEEN" 

860 GOTO 918 * .. . : * X. ; . ■■ ' 

870 PRINT "KING" 

888 GOTO 910 

390 PRINT "ACE" - ^ 

916 IF OA THEN 938 '.'"■■-.'.' 

920 GOTO 970 • ^ : -. . 

930 IF C>=B THEN 970 U,v ...■■'•-■ • '. 

950 PRINT "VOU WIN I i I" < 

960 GOTO 218 ■"" ;" !■>;■' V : . V>i-, 

978 PRINT "SORRY, VOU LOSE." V X 

980 IF M<Q THEN 248 

1000 PRINT \ • 

1016 PRINT "SORRY, FRIEND, BUT VOU BLEW YOUR WAD." 

1020 INPUT "TRY AGAIN <VES Oft. NO) "j A*.- ■'•■/•■>. 

1838 IF A#="VES" THEN 118 .,,-.. "',,: 

1040 PRINT:PRINT "O.K. HOPE VOU HAD FON ! ! " -X ■;'■:■.,. jZJ. 

1850 END 

READY 



■runna^ ■.;.;. ;?/X ; :*;: '. "iV- t-v-- ; . . 

fiCEY-DUCEV IS PLAYED IN THE FOLLOWING MANNER: 

THE DEALER •; COMPUTER) DEALS TWO CARDS FACE UP 

VOU HAVE THE OPTION TO BET OR NOT TO SET DEPENDING 

ON WHETHER OR NOT VOU FEEL THE NEXT CARD WILL HAVE 

A VALUE BETWEEN THE FIRST TWO. 

IF VOU DO NOT WANT TO BET, INPUT A 0. 

VOU NOW HAVE 180 DOLLARS. 

HERE ARE VOUR NEXT TWO CARDS. . . 



WHAT IS YOUR BET? 10 
-.. 6 

SORRY, YOU LOSE. 
YOU NOW HAVE 90 DOLLARS. 
HERE ARE YOUR NEXT TWO CARDS. 

6 
QUEEN 

WHAT IS YOUR BET? 28 

JACK 

VOU WIN! ! !• ■■■•' 

YOU NOW HAVE 110 DOLLARS. 

HERE ARE VOUR NEXT TWO CARDS. 

. 18 

KING - 

WHAT IS YOUR BET? 8 
CHICKEN! ! 

HERE ARE VOUR NEXT TWO CARDS. 



WHAT IS VOUR BET? 38 

18 
SORRY, VOU LOSE. 
YOU NOW HAVE 88 DOLLARS. 
HERE ARE VOUR NEXT TWO CARDS. 

3 ' 



WHAT IS VOUR BET? 28 
2 

SORRY, YOU LOSE. 

YOU NOW HAVE 60 DOLLARS. 

HERE ARE VOUR NEXT TWO CARDS. 



WHAT IS VOUR BET? 8 
CHICKEN! ! 

HERE ARE VOUR NEXT TWO CARDS. . . 

■ 2 ' 
4 

WHAT IS YOUR BET? 8 
CHICKEN!! , ; . 

HERE -ARE YOUR ;NEXT TWO CARDS. . . 

■ 10 ' ... 

WHAT J S VOUR BET? 8 
.CHICKEN .! ! ;; 

vHERE ARE YOUR, NEXT TWO CARDS. . . 

. FICE 

WHAT IS YOUR' BET? 188 

SORRY, MV FRIEND, BUT YOU BET TOO MUCH 

YOU HAVE ONLY 68 DOLLARS TO BET. 

WHAT IS YOUR BET? 68 

5' 
YOU WIN!!! 

YOU NOW HAVE 128 DOLLARS. 
HERE ARE VOUR NEXT TWO CARDS. 

5 



WHAT IS VOUR BET? 20 

P 
SORRY, YOU LOSE. 
YOU NOW WAVE 408 DOLLARS. 
HERE ARE VOUR NEXT TWO CARDS. 

3 • ' 



WHAT IS YOUR BET? 90 

10 

SORRY, VOU LOSE. 

VOU NOW HAVE 18 DOLLARS. 

HERE ARE VOUR NEXT TWO CARDS. . . 

2 
JACK 



WHAT IS VOUR BET? 18 

QUEEN 

SORRY, VOU LOSE. 

SORRY, FRIEND, BUT YOU BLEW VOUR WAD 
TRY AGAIN (YES OR NO)? NO 

0. K. HOPE VOU HAD FUN ! ! 



14 



AMAZIN 



DRAW A MAZE 



Description 



This program will print out a different maze every time it 
is run and guarantees only one path through. You can choose 
the dimensions of the maze — -i.e. the number of squares wide 
and long. 

Computer Limitations 

The amount of memory available will determine the maximum 
size maze that may be constructed. An 8K EduSystem 20 
initialized for one user can draw a 13x13 maze. RSTS/E 
can draw a 23 (width of paper limit) x 50 maze, even larger 
using virtual memory. 

Experiment on your system with the maze dimensions in 
Statement 110. 



Program Author 

Jack Hauber 
Loomis School 
Windsor, CT 06095 




15 



PROGRAM LISTING 



RMA2IN EDUSVSTEM 20 

100 RANDOMIZE 

110 DIM WC25, 102>, VC25,102> 

120 PRINT "WHAT ARE YOUR WIDTH AND LENGTH?" 

121 INPUT H, V 

122 PRINT 

130 IF HOI THEN 150 

131 IF VOl THEN 150 

132 PRINT "MEANINGLESS DIMENSIONS, TRY AGAIN" 

140 PRINT 

141 GO TO 120 

150 PRINT 

151 PRINT 

160 LET = 

161 LET 2=0 

162 LET X=INTCRND(0>*H+1> 

163 FOR 1=1 TO H 

170 IF I»X THEN 173 

171 PRINT " :--".: 

172 GO TO ISO 

173 PRINT " : ".; 
180 NEXT I 

190 PRINT" : " 

191 LET C=l 

192 LET W<X, 1>=C 

193 LET C = C + 1 
200 LET R=X 
291 LET S = l 
202 GO TO 260 

210 IF ROH THEN 240 

211 IF SOV THEN 230 

220 LET R=l 

221 LET S = l 

222 GO TO 250 

220 LET R=l 

221 LET S = S + 1 
232 GO TO 250 
240 LET R = R + 1 

250 IF WCR, S)=0 THEN 210 

260 IF R-1=0 THEN 530 

261 IF WCR-1,SK>0 THEN 530 
270 IF S-1=0 THEN 390 

230 IF WCR,S-1K>0 THEN 390 
290 IF R=H THEN 330 
380 IF UCR + 1, S>O0 THEN 320 
310 LET X-INT<RND<0>*3+1> 

320 IF X=l THEN ?SQ 

321 IF X=2 THEN 820 
323 IF X=3 THEN 86© 

330 IF SOV THEN 340 

331 IF 2=1 THEN 370 

332 LET 0=1 

333 GO TO 358 

340 IF WCR, S+D08 THEN 370 
350 LET X=INTCRHDC0>+2+l> 

360 IF X=l THEN 790 

361 IF X=2 THEN 828 

362 IF X=3 THEN 918 

378 LET X=INTCRNDC0>+2+l> 

380 IF X=l THEN 798 

381 IF X=2 THEN 828 
398 IF R=H THEN 47© 

400 IF WCR+1,SK>0 THEN 470 
481 IF SOV THEN 428 

410 IF 2=1 THEN 45© 

411 LET 0=1 

412 GO TO 430 

420 IF WCR, S + DO0 THEN 450 
430 LET X=INTCRNDC0>+2+i> 

440 IF X = l THEN 790 

441 IF X=2 THEN 868 

442 IF X*2 THEN 918 

450 LET X=INTCRNDC0>*2+1> 

460 if x*i Then 790 

461 IF X=2 THEN 868 
478 IF SOV THEN 490 

480 IF 2=1 THEN 520 

481 LET 0*1 

482 GO TO 508 

490 IF WCR, S + 1K>8 THEN 520 

580 LET X=INTCRNDC0>+2+l> 

518 IF X=l THEN 790 

511 IF X=2 THEN 910 

520 GO TO 790 

530 IF S-1=0 THEN 670 

540 IF WCR, S-1K>0 THEN 670 

541 IF R=H THEN 610 

542 IF W<R+1,SK>0 THEN 610 

550 IF SOV THEN 560 

551 IF 2=1 THEN 598 

552 LET 0*1 

553 GO TO 578 

568 IF WCR, S+1K>8 THEN 598 
570 LET X=INTCRNDC0>*2+1> 

580 IF X=l THEN 828 

581 IF X=2 THEN 868 

582 IF X = 2 THEN 918 

598 LET X=INT<RNDC0>*2+1> 

680 IF X = l THEN 828 
601 IF X=2 THEN 868 
610 IF SOV THEN 638 

620 IF 2=1 THEN 660 

621 LET 0=1 

622 GO TO 640 

630 IF WCR, S + DO0 THEN 6SQ 
640 LET X-INT<RND<0)*2+1) 

650 IF X=l THEN 828 , 

651 IF X=2 THEN 918 
66& GO TO 828 

678 IF R=H THEN 748 

688 IF WCR+1,SK>0 THEN 748 

681 IF SOV THEN 788 
698 IF 2=1 THEN 738 



691 LET 0=1 

692 GO TO 838 

780 IF WCR,S + 1>O0 THEN 720 

710 LET X=INTCRNDC0>*2+1> 

728 IF X=l THEN 868 

721 IF X=2 THEN 918 

738 GO TO 868 

748 IF SOV THEN 760 

750 IF 2=1 THEN 788 

751 LET 0=1 

752 GO TO 778 

760 IF WCR, S + DOO THEN 788 
??0 GO TO 918 
788 GO TO 1800 
790 LET WCR-1, S)»C 

800 LET C=C+1 

801 LET VCR-1, S)=2 
882 LET R=R-1 

818 IF C=H*V+1 THEN 1818 

811 LET 0=8 

812 GO TO 268 

828 LET WCR,S-1)=C 

838 LET C=C+1 

848 LET VCR,S-1> = 1 

841 LET S=S-1 

842 IF C=H*V+1 THEN 1818 
858 LET 0=8 

851 GO TO 268 

860 LET W<R+1,S>=C 

870 LET C=C+1 

871 IF VCR, S>=0 THEN 888 

872 LET VCR, S>=2 

873 GO TO 898 
880 LET V<R, S>=2 
398 LET R=R+1 

900 IF C=H*V+1 THEN 1016 
982 GO TO 530 
910 IF = 1 THEN 9€H> 
92Q LET NCR, S+1>=C 

921 LET C=C+1 

922 IF VCR, S)=8 THEN 948 
938 LET V<R, S)=3 

931 GO TO 958 
948 LET VCR, S)=l 

950 LET S=S+1 

951 IF C=H*V+1 THEN 1818 

952 GO TO 260 
960 LET 2=1 

970 IF VCR, S)=0 THEN 988 

971 LET VCR, S>=3 

972 LET 0=8 

973 GO TO 1800 

980 LET VCR,S)=1 

981 LET 0=0 

982 LET R=l 
99Q LET S=l 
991 GO TO 250 
1800 GO TO 210 

1010 FOR J*l TO V 

1011 PRINT'M".; 

1012 FOR 1=1 TO H 

1813 IF VCI,J><2 THEN 1030 

1020 PRINT" 

1021 GO TO 1040 
1630 PRINT" I".; 

1040 NEXT I 

1041 PRINT 

1842 FOR 1=1 TO H 

1045 IF VCI,J>=0 THEN 1060 

1850 IF VCI, J)=2 THEN 1060 

1051 PRINT" : "; 

1052 GO TO 1070 
1060 PRINT " :— ".; 

1070 NEXT I 

1071 PRINT" : " 

1072 NEXT J 
1072 END 



SAMPLE RUN 



AMA2IN EDUSVSTEM 20 



WHAT ARE YOUR WIDTH AND LENGTH? 
IS, 7 



I 

! 
I 

I 




I 
I 
I 

I 

I 


- 


--:- 


" 


- 



16 



ANIMAL 



COMPUTER GUESSES YOUR ANIMAL 



Description 



Unlike other computer games in which the computer picks a 
number or letter and you must guess what it is, in this 
game you think of an animal and the computer asks you 
questions and tries to guess the name of your animal. If 
the computer, guesses incorrectly, it will ask you for a 
question that differentiates the animal it guessed from the 
one you were thinking of. In this way the computer "learns" 
new animals. Questions to differentiate new animals should 
be input without a question mark. 

IMPORTANT: At the end of a playing session, to the question, 
"ARE YOU THINKING OF AN ANIMAL," you must respond "SAVE" 
in order that the computer save all the new animals you have 
introduced. To that same question, at any point in the game, 
if you respond "LIST," the computer will tell you all the 
animals it knows so far. 

The program starts originally by knowing only "FISH" and 
"BIRD." Additional animals are stored in the file "ANIMAL. GME. " 

Computer Limitations 

This program was written for a DIGITAL RSTS-11 and uses several 
unique features, in particular, multiple user access to a 
common data file and several advanced string handling functions. 
It has been converted with some minor changes to OS/8 BASIC 
and could be adapted to other systems as well. 



Program Author 

Nathan Teichholtz 

Digital Equipment Corporation 

Maynard, MA 01754 




17 



PROGRAM LISTING 



SAMPLE RUN 



CREATED 06-APR-73 04144 PM 

100 & H PLAY 'GUESS THE ANIMAL' WITH RSTS 

150 & M THINK OF AN ANIMAL AND THE COMPUTER WILL TRY TO GUESS IT.,.»i& 

500 DIM A$(200) 

525 F$«"ANIMAL t GME'» 

ION ERROR GOTO 700 
550 OPEN F$ FOR INPUT AS FILE IX 

i input #ix,nx 

IINPUT mliAsdX) PO" IX«lXTO MX 
ICLCSE IX 

:a$(0X)«num$(nx) 
ion error goto 

IGOTO 1300 
700 ON ERROR GOTO 1050 
|F$""$"+F$ 
•RESUME 550 
1050 READ A$(IX) FOR IX*0X TO 3X 

1100 DATA "4%"\QD0ES IT SWIMVY2\N3\« , "\AFISHS »\ABIRD" 
1300 INPUT "ARE YOU THINKING OF AN ANIMAL"fZ9$ 
IGOTO 1350 IF LEPT(Z9$,1X)""Y» 
IGOTO 1300 JF LEFT(Z9$,1%)»«N« 
1310 IF z9$sMSAVE» THEN 

OPEN "ANIMAL. GME" FOR OUTPUT AS FILE lX 
JPRINT #1X,AS(IX) FOR IX.0X TO VaL(A$(0X)3 
tPRlNy -#1,CHR$C26%) 
JCLOSE IX 
IGOTO 1300 
1320 IF Z9$b"LIST" THEN 

prim "Animals i already know arei" 

iprint right(a$cix),3x), if instr ( 1 %, as ( ix) , »\a» ) for ix«1x to 20 

tPRINT 

IGOTO 1300 
1350 K%*1% 
1400 kX«FnAX(A$(kX)) 

IGOTO 3000 IF LEN(A$(Kx,))»0% 

IGOTO 1400 IF LEFT(A$(KX),2X)« H \Q" 

IPRINT "IS IT a ,, RI6HTCaS(KX),3X)I 

IINPut Z7$ 

IZ7$»LEFT(Z7$,1X) 
1450 IF Z7$«»Y" THEN 

PRINT "WHY NOT T»Y ANOTHER ANIMAL" 

tGOTO 1300 
2000 INPUT "THE ANIMAL YOU WERE THINKING OF WAS A "|Z9S 
2050 PRINT "PLEASE TYPE IN A QUESTION THAT WOULD DISTINGUISH A " 

Z9« " F ROM A "RIGHTCA$(KX),3X) 

IINPUT Z8S 
2100 PRINT "FOR A "Z9$" ThE ANSWER WOULD BE»» 

{INPUT Z7$ 

|Z7S«LEFT(Z7$#U) 

llF Z7S«"Y" THEN Z6$«"N« 

ELSE IF Z7$»«Nn THEN Z6$»«Y» 
ELSE PRINT "PLEASE ANSWER 'YES' OR 'NO'" 
IGOTO 2100 
2200 Z1X>VAL(AS(0X)) 

|A$(0%)»N.UM$(Z1.X + 2X) 

lA$(zlX)«A$(KX) 

:As(ZlX+lX)"«\A'+Z9$ 

|A$(KX)B"\Q"*Z8$ + ,, \ H + Z7S + NUM$(ZlX+lX)+' , S» + Z6* + NUMS(ZlX5 + »\» 
2300 GOTO 1300 
3000 DEF FNA%(Q$) 

I PR I NT MID (Q$,3X, INSTR (3X, Q$, "\")-3X}> 

I INPUT Z9$ 

I29$«LEFTCZ9$,U) 

|Z9$«"N" IF Z9$o"Y" 

tZlX«INSTR(3X f Q$,«\"+Z9$3+2X 

IZ2X«INSTR(Z1X,Q$,"\") 

|FNAX"VALcMI0(0S,Zl%,Z2X«ZlX)) 

IFNEND 
9999 END 



PLflV 'GUESS THE ANIMAL' WITH RSTS 

THINK OF AN ANIMAL AND THE COMPUTER WILL TRV TO GUESS 



IT. 



ARE VOU THINKING OF AN ANIMAL? VES 
DOES IT SWIM? VES 
IS IT A FISH? NO 

THE ANIMAL VOU WERE THINKING OF WAS A ? SEAL 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A SEAL FROM A FISH 
? DOES IT HAVE FLIPPERS 
FOR A SEAL THE ANSWER WOULD BE? VES 
ARE VOU THINKING OF AN ANIMAL? VES 
DOES IT SWIM? NO 
IS IT A BIRD? NO 

THE ANIMAL VOU WERE THINKING OF WAS A ? ELEPHANT 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A ELEPHANT FROM A BIRD 
. ? DOES IT HAVE A TRUNK 

FOR A" ELEPHANT THE ANSWER WOULD BE? VES 
ARE VOU THINKING OF AN ANIMAL? VES 
DOES IT SWIM? NO 
DOES IT HAVE A TRUNK? NO 
IS IT A BIRD? NO 

THE ANIMAL VOU WERE THINKING OF WAS A ? DOG 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A DOG FROM A BIRD 
'.? DOES IT GO 'ARF, ARF' 
FOR A DOG THE ANSWER WOULD BE? VES 
ARE VOU THINKING OF AN ANIMAL? VES 
DOES IT SWIM? NO 
DOES IT HAVE A TRUNK? NO 
DOES IT GO -ARF? NO 
IS IT A BIRD? NO 
)% THE ANIMAL VOU WERE THINKING OF WAS A ? CAT 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A CAT FROM A BIRD 

? DOES IT HAVE RETRACTIBLE CLAWS 

FOR A CAT THE ANSWER WOULD BE? VES 

ARE VOU THINKING OF AN ANIMAL? VES 

DOES IT SWIM? NO 

DOES IT HAVE A TRUNK? NO 

DOES IT GO 'ARF? NO 

DOES IT HAVE RETRACTIBLE CLAWS? VES 

IS IT A CAT? NO 

THE ANIMAL VOU WERE THINKING OF WAS A ? TIGER 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A TIGER FROM A CAT 

? DOES IT LIVE IN THE JUNGLE 

FOR A TIGER THE ANSWER WOULD BE? VES 

ARE VOU THINKING OF AN ANIMAL? VES 

DOES IT SWIM? NO 

DOES IT HAVE A TRUNK? NO 

DOES IT GO 'ARF? NO 

DOES IT HAVE RETRACTIBLE CLAWS? NO 

IS IT A BIRD? NO 

THE ANIMAL VOU WERE THINKING OF WAS A ? COW 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A COW FROM A BIRD 

? DOES IT GIVE MILK AND GO 'MOO' 

FOR A COW THE ANSWER WOULD BE? VES 

ARE VOU THINKING OF AN ANIMAL? VES 

DOES IT SWIM? NO 

DOES IT HAVE A TRUNK? NO 

DOES IT GO 'ARF? NO 

DOES IT HAVE RETRACTIBLE CLAWS? NO 

DOES IT GIVE MILK AND GO ' MOO' ? NO 

IS IT A BIRD? NO 

THE ANIMAL VOU WERE THINKING OF WAS A ? GOAT 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A GOAT FROM A BIRD 

? DOES IT GIVE MILK AND EAT TIN CANS AND ALMOST ANVTHING ELSE 

FOR A GOAT THE ANSWER WOULD BE? VES 

ARE VOU THINKING OF AN ANIMAL? VES 

DOES IT SWIM? VES 

DOES IT HAVE FLIPPERS? NO 

IS IT A FISH? NO 

THE ANIMAL VOU WERE THINKING OF WAS A ? WHALE 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A WHALE FROM A FISH 

? IS IT THE LARGEST KNOWN MAMMAL 

FOR A WHALE THE ANSWER WOULD BE? VES 

ARE VOU THINKING OF AN ANIMAL? LI ST 

ANIMALS I ALREADV KNOW ARE : 

SEAL ELEPHANT DOG CAT TIGERS 

COW BIRD GOAT FISH WHALE 



ARE VOU THINKING OF AN ANIMAL? VES 
DOES IT SWIM? NO 
DOES IT HAVE A TRUNK? NO 
DOES IT GO 'ARF? NO 

DOES IT HAVE RETRACTIBLE CLAWS? NO 
DOES IT GIVE MILK AND GO 'MOO'? NO 

DOES IT GIVE MILK AND EAT TIN CANS AND ALMOST ANVTHING ELSE? NO 
; IS IT A BIRD? NO 
THE ANIMAL VOU WERE THINKING OF WAS A ? SHEEP 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A SHEEP FROM A BIRD 
? DOES IT HAVE A 'WOOLS' COAT AND SAV 'BAA, BAR' 
FOR A SHEEP THE ANSWER WOULD BE? VES 
ARE VOU THINKING OF AN ANIMAL? VES 
DOEff IT SWIM? NO ■■■ 
DOES IT HAVE A TRUNK? NO 
DOES IT GO 'ARF? NO 

DOES IT HAVE RETRACTIBLE CLAWS? VES 
DOES IT LIVE IN THE JUNGLE? VES 
IS IT A TIGER? NO . 

THE ANIMAL VOU WERE THINKING OF WAS A ? LION 

PLEASE TVPE IN A QUESTION THAT WOULD DISTINGUISH A LION FROM A TIGER 
? IS IT THE KING OF THE JUNGLE 
FOR A LION THE ANSWER WOULD BE? VES 
ARE VOU THINKING OF AN ANIMAL? SAVE 
ARE VOU THINKING OF AN ANIMAL? NO 
ARE VOU THINKING OF AN ANIMAL? ~C 

READV 



■18 



AWARI 



REMOVE BEANS FROM THE PITS 



Description 



My 
HOME 









My SIDE 




6 


5 


4 


3 


2 


1 


ooo 


ooo 


ooo 


ooo 


ooo 


ooo 


ooo 


ooo 


ooo 


ooo 


ooo 


ooo 


1 


2 


3 


4 


5 


6 



Your 
HOME 



Your SIDE 

AWARI game is played with seven sticks and thirty-six stones 
(beans) laid out as shown above. The board is divided into six 
compartments (PITS) on 'my SIDE 1 and six on 'your SIDE' . In 
addition, there are two special PITS at the ends: 'my HOME 1 
and 'your HOME' . 

A MOVE is made by taking all of the beans from any (non-empty) 
PIT on your own SIDE. Starting from the PIT to the right of 
this one, these beans are 'SOWN' one in each PIT working around 
the board anticlockwise. 

A TURN consists of one or two MOVEs. If the last bean of your 
MOVE is SOWN in your own HOME you may take a second MOVE. 

If the last bean SOWN in a MOVE lands in an empty PIT, provided 
that the opposite PIT is not empty/ all the beans in the opposite 
PIT, together with the last bean SOWN are "' captured ' and moved 
to the player's HOME. 



When either side is empty, the game is finished, 
with most beans in his HOME has won. 



The player 



19 



In the computer version, the board is printed as 14 numbers 
representing the 14 PITS* 

3 3 3 3 3 3 



3 3 3 3 33 

The PITS on your (lower) SIDE are numbered 1-6 from left to 
right. The PITS on my (the computer's) SIDE are numbered from 
my left (your right). 

To make a MOVE you type in the number of a PIT. If the last bean 
lands in your HOME, the computer types 'AGAIN? 1 and you then type 
in your second move. 

The computer's MOVE is typed, followed by a diagram of the board 
in its new state. The computer always offers you the first move. 
This is considered to be a slight advantage. 

There is a learning mechanism in the program that causes the 
play of the computer to improve as it plays more games. 

Computer Limitations 

This program is written in DIGITAL PDP-11 BASIC. The only 
unusual feature is that an IF statement may have the form: 

IF (CONDITION) THEN (STATEMENT) 

Whenever the IF condition fails, the program branches to the 
next line. 

Program Author 

A version of AWARI, called KALAH, was submitted by Christopher 
Stolz of Lexington High School. The version published (also 
known as BEANS) along with the description above was written by: 

Geoff Wyvill 
Bradford University 
Bradford, Yorkshire, England 



20 



PROGRAM LISTING 



SAMPLE RUN 



5 DATA0 

10 OlMBCl3)»GC13),F(50)|Hfc-AON 

lb FORI«0TON-l:REAOF(I)|N£XTI 

20 PRINT-VPRINT "GAME OF *** AWARI ***«\E«« 

25 FORI«0TO12lLETB(I)«3|NEXTI 

30 LtTC»0:LETF(NJ«0iUETB(l3)«0»LET8(6)»0 

35 GOSUB500 

40 PRINT»YOUP HOVE»MGOSUB110 

45 IFK«P»GOTO80 

50 IFrtiHTH-ENGt)SUB-10fi\ 

55 IFE»WGOTO80 

60 PRINT»HY -MOVE 1 S » » t GOSUB800 

65 IFES0GOTO80 

70 IFH«HTHENPRINT» ,«MGOSuB800 

75 IFE>*G0T035 

80 PRInT:PRINT"GAME OVER" 

85 LET DaB(6)-S(13):IF D<0 THEN PRINT "I WIN BY" t -D»P0INTS" iGOTO 20 

90 LETN = N+HIH)«0THENPRINT"DRAWN GAME'MGOTO 20 

95 PRINT«YOU WIN BY »D»POInTS" 1 GOTO20 

100 PRINT M A6AIN»'I 

110 INPUTMiIFK<7TMENlFM>0T.HENLETM»M-liGOTO130 

120- PRINTMLLEGAL MOVE" J GQTO100 

130 IPB(H)«OGOTO120 

140 LETM»b;GQSUB20^ 

150 GOTO500 

200 LETK«*»GOSUB6«d0 

205 LETE«0iIFK>6THEMLETK«K-7 

210 LETC = C + 1SIFC<9THEnLF.TF(N)*F(N)*6 + K 

215 FORl»0TO5lIFe(I)oaTHeN230 

220 NEXTI 

225 RETURN 

230 FORla7TO12;IFB(I)<>0THEMETE*HRFTURN 

235 GOTO 220 

500 PRlNTjPHlNT" "I 

505 "FORI«12TO7STEP-1!GOSUB580 

510 NEXTI 

515 PRINT«LETI»13(G0SUB583I 

520 PRImT," "MPRINTPC6) JPRINT" "I 

525 FORI"0TO5tGO3UB580. 

530 NfcXTI 

535 PRInTjPPIN-TjPETURn 

580 IF8(I)<10T*E*PRINT" ") 

585 PKlNTB(I)M«ETU.RN 

600 LETP«B(M)iLETBCM)"0 

605 F0RP»PTD18TfcP-i:LETM«M+llIFM>13THENLETM»M-i4 

610 LtTB(M)«8(M) + UNExTP 

615 IFB(M)«iTHENlPM<>6THENlFMO.l3THENIF8(l2-M)<>0e.OTO628 

620 RETURN 

'625 L.ETBCH)*b(H)*BCi2-M) + i:LETB(^)«0»LETB(12-M)s0 {RETURN 

800 L£TD«-99!LETHsl3 

805 F0RI»t?T013»LETG(I)BBCl)*NEXTI 

810 FORJ»7TO12!IF8CJ)«0THEN885 

815 L£TGae!LETMaJJGOSUB600 

820 FORI"0TOSlIFP(I)«BGOTO845 

825 LtTL«8(I)+I»LtTR"0 

830 IFL>13TMENLETL«L-14iLETH«HGOTO830 

835 IFB(L)=BTHEMFL<>6TriENlFL<>13THENLETR«B(12-L)+R 

840 IFR>QTHENLETQ*R 

845 NEXTI 

850 LETGsB(13)-B(6)-Q:iFC>BG0T0875 

855 LETKbJHFK>6ThENLETK»K-7 

860 FORI"0TC'N-liIFF(N)*6 + K«lNT(F(I)/6A(7-C>*.l)THtNLETG»Q-2 

870 NEXTI 

875 FOR I«0TO13ILET8(I)"GCI)I NEXTI 

880 IF&>«DTHEnLETAsjjlE|DsG 

885 NEXTJ 

890 LETM.4;PRINTCHR$C42 + i4)J!GOTO200 

900 FORI»0TON-1 JPRINTF (I)iNEXTI 
999 END 



RUN , 

RWRRI 01:23 PM 

GAME OF *** RWRRI ** 

3 3 3 3 



3 3 3 3 
VOUR MOVE? 5 

3 3 3 3 



MV MOVE IS 
3 4 



VOUR MOVE? 4 



fiGRIN? 1 

3 4 4 



4 4 

MV MOVE IS 4 

5 O 
6 

4 4 

VOUR MOVE? 3 



MV MOVE IS 5 
1 



VOUR MOVE? 2 



1 










1 




2 


2 


FlQftIN? 3 








1 

7 

1 











MV MOVE IS 

1 

8 

1 


6. 


, 1 
1 




1 


VOUR MOVE? 


5 






1 

8 

1 




1 



1 


fiGRIN? 4 








1 
8 

1 




1 



1 



MV MOVE IS 


5 







1 10 

VOUR MOVE? 6 

1 2 2 2 1 
11 

1 10 

MV MOVE IS 6,4 ,''-\; 



14 







VOUR MOVE? 5 
1 







21 



GAME OVER 

VOU WIN BV 3 POINTS 



BAGLES 



NUMBER LOGIC GAME 



Description 



The computer picks a 3-digit secret number and you attempt 
to guess what it is. You are allowed up to twenty guesses. 
No digit is repeated. After each guess the computer will 
give you clues about your guess as follows: 

PICO One digit is correct, but in the wrong place 
FERMI One digit is in the correct place 
BAGLES No digit is correct 

You will learn to draw inferences from the clues and, with 
practice, you'll learn to improve your score. There are 
several good strategies for playing BAGLES. After you have 
found a good strategy, see if you can improve it. Or try 
a different strategy altogether and see if it is any better. 

This program was submitted from several sources including 
Dartmouth and U.C. -Berkeley. The one published here is 
from U.C. 



Program Authors 

D. Resek, P. Rowe 
Lawrence Hall of Science 
University of California 
Berkeley, CA 94700 




22 



PROGRAM LISTING 



SAMPLE RUN 



LISTNH 

5. REM *** BflGLES NUMBER GUESSING GAME 

10 REM *** ORIGINAL SOURCE UNKNOWN -'.BUT SUSPECTED TO BE LAWRENCE HALL 

15 REM *** OF SCIENCE, U. C. BERKELEV. MODIFIED FOR TIMESHARED-8 

26 REM *** BV STUDENTS OF -LEXINGTON HIGH SCHOOL, MA AND MODIFIED FOR 

25 REM *** RSTS/E BV DAVE AHL OF DIGITAL 11/45 GROUP 

20 DIM Rl<6>, A<3>, BO> 

40 RANDOM I ZE:V=0:T=255 

?0 INPUT "GAME OF BAGLES. WOULD VOU LIKE THE RULES CVES OR NO>",A$ 

90 IF A*="NO" THEN ISO 

100 PR I NT .-PRINT "I AM THINKING OF A THREE-DIGIT NUMBER. TRV TO GUESS" 

110 PRINT "MV NUMBER AND I WILL GIVE VOU CLUES AS FOLLOWS:" 

120 PRINT " PICO - ONE DIGIT CORRECT BUT IN THE WRONG POSITION" 

138 PRINT " FERMI - ONE DIGIT CORRECT AND IN THE RIGHT POSITION" 

140 PRINT " BAGLES - NO DIGITS CORRECT" 

150 FOR 1=1 TO 3 

160 Aa:> = INT<10+RND;' 

170 FOR .J=l TO 1-1 

ISO IF fl(I)=fl(J) THEN 160 

190 NEXT J 

200 NEXT I 

210 PRINT: PRINT "O.K. I HAVE A NUMBER IN MIND." 

220 FOR 1=1 TO 20 

220 PRINT "GUESS #"!.; 

240 INPUT A* 

256 CHANGE A* TO Al 

255 IF A1CS><>3 THEN 630 

260 FOR J=l TO 3 

270 IF AKJX48 THEN 300 

280 IF fll<J»57 THEN 300 

285 B(J)=Rl(J)-48 

290 NEXT J 

295 GOTO 320 

300 PRINT "WHAT?" 

310 GOTO 220 

320 IF B<1>=B<2> THEN 650 

230 IF 8<2>=B<3> THEN 650 

340 IF B<2>=B<1> THEN 65© 

350 C=O:D=0 

260 FOR J=l TO 2 

270 IF fl(J)OB(J+l) THEN 390 

380 C=C+1 

390 IF fl<J+l>OB<J> THEN 410 

400 C=C+1 

410 NEXT J 

420 IF fl<l)OB<3) THEN 440 

430 C=C+1 

440 IF fl(3)OB(l) THEN 460 

450 C=C+1 

460 FOR J=l TO 2 

470 IF fl(J)OB(J) THEN 490 

480 D=D+1 

490 NEXT J 

500 IF D=2 THEN 680 

520 FOR J=l TO C 

520 PRINT "PICO ".; 

540 NEXT J 

550 FOR J=l TO D 

560 PRINT "FERMI "; 

570 NEXT J 

580 IF C+DO0 THEN 600 

590 PRINT "BAGLES".; 

600 PRINT 

605 NEXT I 

610 PRINT "OH WELL" 

615 PRINT "THAT'S 20 GUESSES. MV NUMBER WAS "i00*fl<l>M0*fl<2> + flC3> 

620 GOTO 780 

630 PRINT "TRV GUESSING A THREE-DIGIT NUMBER. ":GOTO 230 

650 PRINT "OH, I FORGOT TO TELL VOU THAT THE NUMBER I HAVE IN" 

660 PRINT "MIND HAS NO TWO DIGITS THE SAME. " : GOTO 230 

680 PRINT "VOU GOT IT!!! ".PRINT 

630 V=V+1 

700 INPUT "PLAV AGAIN CVES OR NO)".ifl$ 

720 IF A*="VES" THEN ISO 

730 IF V=0 THEN 750 

740 PRINT .-PRINT "A"V"- POINT BAGLES BUFF!!" 

750 PRINT "HOPE VOU HAD FUN. BVE. " 

999 END 

READV 



RUNNH 

GAME OF BAGLES. 



WOULD VOU LIKE THE RULES <VES OR NO)? VES 



I AM THINKING OF A THREE-DIGIT NUMBER. TRV TO GUE'-'S 
MV NUMBER AND I WILL GIVE VOU CLUES AS FOLLOWS: 

PICO - ONE DIGIT CORRECT BUT IN THE WRONG POSITION 
FERMI - ONE DIGIT CORRECT AND IN THE RIGHT POSITION 
BAGLES - NO DIGITS CORRECT : . 

O.K. I HAVE A NUMBER IN MIND. 

GUESS # 1 ? 122 

PICO PICO 

GUESS #2 ? 412 

PICO PICO 

GUESS # 3 ?. 215 

PICO PICO FERMI 

GUESS # 4 ? 251 

VOU GOT IT! ! ! 

PLAV AGAIN <VES OR;'. NO).? VES 



I HAVE A NUMBER IN MIND. 



0. K. 

GUESS # 1 ? 123 

PICO PICO 

GUESS # 2 ? 412 

PICO FERMI 

GUESS # 3 ? 215 

PICO 

GUESS # 4 ? 432 

FERMI FERMI 

GUESS # 5 ? 431 

VOU GOT IT! ! ! 

PLAV AGAIN <VES OR NO)? VES 

O.'K. I HAVE A NUMBER IN MIND. 

GUESS ..# 1 ?■ 123 

PICO 

GUESS # 2 ? 451 

BAGLES 

GUESS # 3 ? 267 

BAGLES 

GUESS # 4 ? 389 

PICO PICO PICO 

GUESS # 5 ? 893 

PICO PICO PICO 

GUESS # 6 ? 938 

VOU GOT IT! ! ! 

PLAV AGAIN <VES OR NO)? VES 



HAVE A NUMBER IN MIND. 
1 ? 123 



0. K. 

GUESS # 1 
BAGLES 
GUESS # 2 
PICO 

GUESS # 2 
PICO 

GUESS # 4 
PICO PICO 
GUESS # 5 
PICO FERMI 
GUESS # b 
PICO 

GUESS # 7 
VOU GOT IT 



PLAV AGAIN <VES OR NO) 



0. K. I HAVE A NUMBER IN MIND. 
GUESS # 1 ? 123 
PICO 

GUESS # 2,,.? 145 
•BAGLES 

GUESS # 2 ? 267 
P I GO 

GUESS # 4 ? 276 
BAGLES 

GUESS # 5 ? 892 
FERMI FERMI 5 
GUESS # 6 ? 802 
PICO FERMI 
GUESS #7 ? 092 
VOU GOT IT! ! ! 



PLAV ■ A G A I N < V E S R N ) ? N 



A 5 - POINT BAGLES BUFF! 
HOPE VOU HAD FUN. BVE. 



23 



BANNER 



PRINTS A LARGE BANNER 



Description 



This program creates a large banner on a terminal of any 
message you input (up to 54 characters in length) • The 
letters may be any dimension you wish although the letter 
height plus distance from left-hand side should not exceed 
6 inches. Also, the letter height should be somewhat more 
than the width. Adhering to these rules will generally produce 
a very attractive banner. 

Computer Limitations 

BANNER was written for a DIGITAL EduSystem 50. For other 
computers, the character string line input (LINPUT) statement 
at Line 240 would have to be changed. 

Program Author 

Daniel R. Vernon 

Butler Senior High School 

Butler, PA 16001 




24 



PROGRAM LISTING 



PROGRAM WRITTEN BY DANIEL R. VERNON 
SENIOR AT BUTLER SENIOR HIGH SCHOOL 

BUTLER, PENNSYLVANIA 16001 
OATEl 2/1/73 

COMPUTER SUPERVISION- MR, WILLIAM ELLIS 
COMPUTER TOPICS INSTRUCTION- MR. ALBERT STEWART 

THIS PROGRAM IS DESIGNED TO CREATE POSTERS 



100 REM 

110 REM 

120 REM 

130 REM 

U0 REM 

150 REM 

160 REM 

170 REM 

180 REM 

190 DIMGS(6),HS<6),B$C9),G(8),A(54) 

200 PRINT»INPUT HEIGHTH, WIDTH IN INCHES* J\INPUTL,R\S»0\A«R*2SC*A 

210 PRINT»HOW PAR, IN INCHES FROM THE LEFT HAND SIDE, DO YOU WANT TO PLACE " 

220 PRINT»THE LETTERS»l\lNPUTS\Si!2*S 

230 PRINT«INPUT MESSAGE HERE" 

240 LINPUTB$<i),BSC2),BS<3),B$C4),BS<5),8S(6),8$C7),B$C8),BS(9) 

250 F0RX*9T01STEP-l\CHANGEB$CX)T0A\F0RYPiT06\A(X*6-6*Y)*ACY)\NEXTYVNEXTX 

260 P0RXilT06\READHS(X)VN£XTXSHSiHsa>\G03UB 940 

270 F»F*l\IFA(F)i0THEN990\G<0)iL\FORXilTO6\G(X)«ACP)\NEXTX\CHANGEGTOGS 

280 FORXflTO6\G(0)tXVCHANGEGTOGS(X)SNEXTX 

290 F0RX»1T0A/2\PRINT\NEXTX 

300 IFA(F)»46THEN345\IPACF)«36THEN990\IFA(F)i32THEN630\IFA(F)<48THEN270 

309 IFA(P)>57THEN310\ONA(F)-47GQTO500,440,620,625,635,550,615,605,595,585 

310 IFA(F)<65THEN270\IFACF)>79THEN330 

320 ONA(P)»64GOTO350, 360, 370, 380. 390,400, 410, 430, 440, 450, 460, 470, 480, 490, 500 

330 IFA>90THEN270\ONA(F)«79GOTO510, 520, 540, 550, 560, 570,-580, 590, 600, 610, 620 

340 GOTO270 

345 FORX«1TOA\PRINTTAB(S)|GS|GS\NEXTXSGOTO270 

350 GOSUB640\GOSUB690\GO8UB640\GOTO270 

360 GOSUB640\GOSUB650\A*C*,5VGOSUB640\A*C\GO3UB610\GOTO270 

370 GOSUB640\GOSUB700\GOSUB700\GOTO270 

380 GOSUB640\GOSUB700VA«C*,5\GOSUB640\AfC\GO3uB640VGOTO270 

390 GOSUB640SGOSUB650\GOSUB650\GOTO270 

400 GOSUB640\GO8UB690\GOSUB690\GOTO270 

410 GOSUB640SA«C*,75VGOSUB700\A>C*.25\GO3UB650VA*C\GOSUB760 

420 AiC*.25\GOSUB710\A*CNGOTO270 

430 GOSUB640\GOSUB7t0\GOSUB640\GOTO270 

440 GOSUB640\GOTO270 

450 GO8UB750\GO8UB740S6OSUB640\GOTO270 

460 GOSUB640\GOSUB860\GOTO270 

470 GO8U8640\GOSUB740\GOSUB740\GOTO270 

480 GOSuB640\GOSgB890\GOSuB880\6OSUB640\6OTO270 

490 GOSUB640\GO8UB890\6OSUB640\GOTO270 

500 GOSUB640\GOSUB700\GOSUB640\6OTO270 

510 GOSUB640\GOSUB690\GOSUB790\GOTO270 

520 GOSUB640\A«C*,75\GOSUB700\A«,25*C\GOSUB650\A"C\6OSUB640 

530 A«C«.25SGOSUB710\A»CNGOTO270 

540 GOSUB640\6OSUB690\A»C*,5\GOSUB640SGOSUB810\A*C\GOTO270 

550 GOSUB770\GOSUB680\GOSUB760\GOTO270 

560 GO3UB780\GOSUB640\6O3UB780\6OTO270 

570 GOSUB640\GOSUB740\GOSuB640\GOTO270 

580 GO8UB890\GOSUB880\GOTO270 

585 GOSUB790\GOSUB690\GOSUB640\GOTO270 

590 GOSUB640\6O8UB880\GOSUB890\GOSU8640\6OTO270 

595 GO3UB640\GO3UB650\GOSUB640\GOTO270 

600 GOSUB900VGOTO270 

605 GOSUB780\6OSUB780\GOSUB640\GOTO270 

610 GO8UB970\GOSUB800\6OSUB960\GOTO270 

615 GOSUB640\GOSUB650\GO3UB760\GOTO270 

620 GOSUB920\GOTO270 

625 GQSUB700VGOSUB650\A«C*,5SGQSUB640\A»C\GOSUB810\6OTO270 

630 GO3UB940SGOTO270 

635 SO8UB790\GO8UB710\GO3UB640\6OTO270 

640 FORY*1TOA\PRINTTAB(S)I\FORX«1TO10\PRINTG$>\NEXTXVPRINT\NEXTY\RETURN 

653 IFA<1THEN660V6OTO670 

660 LETA«1 

670 F0RX»lT0A\PRlNTTABCS)>6$|Gs>H$fHS>6$|G$|HS>H$»6SpG$\NEXTX\RETURN 

680 PRINTTAB(8)I 

690 F0RX*1T0ASPRINTTAB(4*L*S)IGSIGSIH$PHS|G$|G$\NEXTX\RETURN 

700 F0RX»1T0A\PRINTTAB(S)|G$|GSJ\PRINTTAB(8*L+8)|GS|G$\NEXTXNRETURN 

710 IFA«1THEN720\GOTO730 

720 LETA»1 

730 F0RX*iT0A\PRlNTTAB(4*t*3)>G$|GS\NEXTX\RETURN 

740 FORX«lTOA\PRINTTAB(S)lGS>GS\NEXTX\RETURN 

750 F0RX»lT0A\PRlNTTABCS)fG$|6SfG$»G$\NEXTX\RETURN 

760 F0RYilT0A\PRINTTABCS)|GS|G$|G$lG$|G$|6$|HS|H$|6$|GJ\NEXTY\RETURN 

772 F0RXmT0A\PRINTTABCS)>GS)6$|HS|H$|GSjG$lGS|G$»6S>GS\NEXTX\RETURN 

780 F0RX»1T0A\PRINTTAB(8*L*S)IGSIGS\NEXTX\RETURN 

790 F0RX»tT0AVPRlNTTAB(4*L*8)IGSl6SlG$»G$)6$|G$\NEXTXVRETURN 

800 F0RXflT0A\PRINTTAB<S)j6Si6S>G$pGS|G$lG$\NEXTX\RETURN 

810 F0RXttT0C/2\PRlNTTAB(S)l\FORY«lT02NF0RZilTO(5*L)-XSPRINT6S(t)|\NEXTZ 

820 IPX»3THEN950\V*X 

830 PRINTHSC2*V)»\NEXTY\PRINT\NEXTX\RETURN 

840 FORXilTOC/2VPRlNTTAB(S)IHS(X)|\FORYilTOt0*L-(2*X5\PRINTGSei)>\NEXTY\PRINT 

850 NEXTXVRETURN 

860 FOR X«4*LT07*L3TEP14*L/(C*6)\PRINTTAB(X*S)|6S|GSIG$| 

870 PRINTTAB(7*L»X*S)|GS»G$»GS\NEXT X\RETURN 

880 FORXi0TO6*LSTEP6*L/C\PRINTTA8(X*S3lG$>G$»GSpGS\NEXTX\RETURN 

890 FORXi6*LTO0STEP-6*L/C\PRINTTABCX*S)»G$|G$rGS|G$\NEXTX\RETURN 

900 FORXi0TO7*LSTEP(14*L)/(C*6SSPRlNTTABex*3)|GSfG$|6$p 

9t0 printtab(7*l-x*S)»g$;g$;g$\next xsreturn 

920 FORX»0TO7*LSTEP(7*L)/(C*3)\PRINTTAB<S)>G$|G$|TA8(X*S)|GSIG$|GS» 

930 PRINTTAB(8*L*5)I6S»GS\NEXTX\RETURN 

940 F0RX»1T0A*3\PRINT\NEXTX\RETURN 

950 FQRW*1T0X-3\PRINT" "|\NEXTW\V«3\6OTO830 

960 F0RX«4*LT07*L3TEPL*4/C\PRlNTTAB(X*3)f6»»GSIGS\NEXTXSRETURN 

970 FOR X«7*LT04*LSTEP-4*L/C\PRINTTAB(X*S)|G$|GS|G$\NEXTX\RETURN 

980 DATA" ",« »,» »,« «,« »,» «,»* 

990 F0RXilT0C*3VPRINT\NEXTX 

1000 END 



SAMPLE RUN 

INPUT HEIGHTH, WIDTH IN INCHES? 4,3 

HOW FAR, IN INCHES FROM THE LEFT HAND SIDE, DO YOU WANT TO PLACE 

THE LETTERS? 1 

INPUT MESSAGE HERE 

? EDU 9 



EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 

EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE ' 



EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 



EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE ' 
EEEEEEEE- 
EEEEEEEE 



EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 
EEEEEEEE 



DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDD DDDDDDDD 

DDDDDDDD DDDDDDDD 

DDDDDDDD DDDDDDDD 

DDDDDDDD DDDDDDDD 

DDDDDDDD DDDDDDDD 

DDDDDDDD DDDDDDDD 

DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 



uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuu uu uuu uuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuu 

uuuuuuuu 

uuuuuuuu 

uuuuuuuu 

uuuuuuuu 

uuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 



999999999 
999999999 
999999999 
999999999 
999999999 
999999999 
99999999 
99999999 
99999999 
99999999 
99999999 
99999999 
9999999999999999999999999 
9999999999999999999999999 
9999999999999999999999999 
9999999999999999999999999 
9999999999999999999999999 
9999999999999999999999999 



99999 

999999 

999999 

999999 

999999 

999999 



999999 
999999 
999999' 
999999 
999999 
999999 



999999999 
999999999 
999999999 
999999999 
999999999 
999999999 
99999999 
99999999 
99999999 
99999999 
99999999 
99999999 
999999999 
999999999 
999999999 
999999999 

999999999 
999999999 



25 



BASEBL 



BASEBALL GAME 



Description 



This is a simulation of a nine-inning baseball game with you 
controlling the pitcher when your team has the field and 
controlling the batter when you are up to bat. The simulation 
stops at nine innings, hence, it may be a tie game; however, 
that has proved to occur remarkably few times. 

Computer Limitations 

The game published was written for DIGITAL EduSystem 15/30/35 
and actually consists of two programs, one which prints the 
rules chained to the second program which plays the game. 
"NOLINE" must be given before running to prevent overflow. 
Other BASIC compilers will require conversion of the alphabetic 
string input statements to a compatible format. 

Source 

Another version of baseball was submitted for Timeshared-8 
by Jeff Moskow and Brad Golden of Lexington High School. 
This is available from DECUS as BASIC 8-562. A second version 
was submitted by another Lexington High School student, Les 
Servie. A FORTRAN version was submitted by David Benepe of 
Fort Worth, Texas. These versions are not printed herein. 

Jack Huisman 

Oregon Museum of Science and Industry 

Portland, Oregon 97200 



F^^ J5l£l 




PROGRAM LISTING 



BA8BAL EDUSYSTEM-35 

100 DIMT(50),CCl9),F(l9),ZCi9) 

110 F0RXMT019VREADC(X),Z(X),P(X)VNEXTXVLETX«1 

120 PRINT«WELCQME TO HUISMAN STADIUM FOR TODAY'S GREAT GAME BETWEEN" 

130 PRINT«THE PDP-8 PANTHERS AND (YOUR NAME PLEASE) THE «? 

140 FOR A*l TO 99MNPUT $T(A)\IF T(A)*141 THEN 150\NEXT A 

150 LETT"A\PRINT\PRINT W A HIGHLY PARTISAN CROWD OF"? 

160 FQRA«1TQTVLETB*2*RNDC0)VNEXTA 

170 LET A«INT(70000*RND(1))VPRINTA? 

180 PRINT"FANS IS ANXIOUSLY AWAITING THE" VPRINT«START OF THE GAME," 

190 PRINT«HERE IS MY TEAM!", "AND HERE IS YOURS!" 

200 PRINT"NAME», "AVERAGE", "NAME", "AVERAGE" 

210 PRINT" — • •%«•*.— -«, »- — ", •»»—.— « 

220 GOSUB 400 

230 PRINTVPRINT 

240 PRINT"THE PANTHERS ARE TAKING THE FIELD NOW AS ANDREWS OF THE" 

250 FOR A*l TO T-1VPRINT CHR$ (T (A) ) ? VNEXT A 

260 PRINT" ADVANCES TO THE PLATE. PLEASE WAIT AS THE COMPUTER SINGS" 

270 PRINT"OUR NATIONAL ANTHEM TO ITSELF • 2 OR 3 TIMES! JUST SING" 

280 PRINT"AL0NG UNTIL ASKED FOR YOUR PLAY, "SPRINT 

290 GOTO580 

300 DATA, 03, ,412001, ,05, ,02, ,263001, ,03 

310 DATA-. 02, ,236001, ,02, ,03, ,316001, -,01 

320 DATA, 01,, 24 1001,, 03,. 02,, 321001,, 02 

330 DATA-, 02,, 367001,, 02, -,02,, 386001, -,01 

340 DATA, 01,, 295001,, 03, -,01,, 296001,, 02 

350 DATA-, 02, ,319001, ,02, -,02,, 285001, ,02 

360 DATA-, 03,, 295001,, 01,, 02,. 295001,, 03 

370 DATA, 02,, 2 18001,, 02,, 02,, 139001, -.02 

380 DATA, 03,, 238001, ,01 , ,03, ,231001 , -.02 

390 DATA 0,0,0 

400 PRINT«HUISMAN",Z(1),"KL00S«,Z(2) 

410 PRINT"H0EREN",ZC3),»ANDREWS",ZC4) 

420 PRINT«BACCUS",Z(5) , "MAYER", 2(8) 

430 PRINT"SMITH",Z(7), "HANSEN", Z(6) 

440 PRINT"SCHNEI0ER",ZC9) , "MICHEL", Z(10) 

450 PRINT"ROSEN8AUM",ZCll),'«P, D, PEATE",Z(12) 

460 PRINT»POULSEN",ZC 13), "WILLIAMS", Z( 14) 

470 PRINT"K ILGOUR",Z( 15), "NELSON", Z( 16) 

480 PRINT "JOHNSON", Z(17),"ANKC0RN",ZC18) 

490 PRINT»WHITNEY",« MANAGER" , "I VEY », " M ANAGER«\PRINT 

500 PRINT"PITCHER*S OPTIONS ARE ! " VPRINT"FAST8ALL" 

510 PR I NT«BE ANB ALL " V PR I NT "BRUSHBACK" VPRINT "BALL "VPRINT "CURVE" 

520 PRINT"SLIDER"SPRINT"KNUCKLE"\PRINT«GREASEBALL (ILLEGAL) " 

530 PRINT"SPITBALL ( ILLEGAL) "VPRINT"CHECK" VPRINT 

540 PRINT"BATTER'S OPTIONS ARE S « VPRINT"8UNT« VPRINT"SWING" 

550 PRINT«HIT-AWAY" VPRINT "SACRIFICE "VPRINT "GROUNDER "VPRINT "FLY" 

560 PRINT«KILL"VPRINT 

570 RETURN 

580 CHAIN»BASBL1" 

590 END 



BASBL1 EDUSYSTEM-35 

100 DIMB(16) 

110 LETZ(0)s,5\LETZ«,5 

120 LETI»1 

130 LETBls0VLETB2=0\LETB3«0\LETIl«0\LETI2»0\UETI3«0 

140 LETC1*0\LETC2S0\PRINT 

150 IFC2<»4TMEN160\PRINT"THE BATTER WALKS. "VGQSUB920VGOTQ140 

160 IFC1<>3THEN180\PRINT"THE BATTER STRUCK OUT,"\LET C3»C3+1 VGOTO140 

170 IF SlelTH£Nl80\LETXBX+i 

180 IFC3<3THEN270\IFS1»1THEN190\LETS1M\GQTO200 

190 PRINT"AFTER"?I?"INNING$"?VLETI«I*1VLETS1«0 

200 PRINTI2;"RUNS,»;ilJ"HITS,"II3;"ERRORS AND" ; B 1+B2+B3? "LEFT ON BASE, 

210 IFI*5THEN1420\lFSl80THEN230VPRINT"I f M»j\GQTO240 

220 IFSl=0THEN230\PRlNT"I'M"f\GQTO240 

230 PRINT"YQU'RE"; 

240 PRINT" UP NOW,»\PRINT"SCOREl ME" J S2; "YOU" I S3 

250 PRlNT\LETC3s0 

260 GOTO130 

270 PRINT"YOUR PLAY? "? 

280 FORA3lTO20MNPUTSB(A)\IFB(A)al41THEN290\NEXTA 

290 LETD31*RND(5)VPRINT 

300 LETC*100*B(1)+BC2)\IF S1*0TH£N420 

310 IFC<>19713THEN320\LETD«D+C(X)\GOTO1280 

320 IFC<>19993THEN330VLETD*D+F(X)VGOTO1280 

330 IFC»19597THEN1280 

340 IFCal9610THENl280 

350 IFC*21304THEN1280 

360 IFC"20506THEN1280 

370 IFC<>20110THEN380\IFD«,8THEN1280\GOTO1270 

380 IFC<>21308THEN390\IFO<,8THENi280\GOTO1270 

390 IFC«>19700THEN400\PRINT"RUNNERS ARE STICKING, "\GOTO270 

400 IFC<M9593THEN410\PRINT"MY BATTER" ; \GOTO1300 

410 FORAl«ATOA-l\PRINTCHR$(B(Al)) ?\NEXTA1\PRINT«?"\GQTO270 

420 IPC<>19613THEN430\PRINT"YQUR BATTER" ? VGQSUB570VGOTQ140 

430 IFC»21315THEN1280 

440 IFC<>19700THEN450\PRINT"CHECK NOT YET IN,"\GOTO270 

450 IFCs20201THENl280 

460 IFC<>21312THEN470\PRINT"STEAL NOT YET IN,"\GOTO270 

470 IFCn2i293THENl280 

480 lFCs20110THEN1280 

490 IFC-20004THEN1280 

500 IFC-20501THEN1280 



510 GOTO410 

520 LETA"9*RND(65\IF$1"0THEN530\PRINT<'MY BATTER" ? VGOTQ540 

530 PRINT"YOUR BATTER"? 

540 IFAMTHEN550VPRINT" LINED OUT TO THE THIRD BASEMAN, "\GOTO840 

550 IFA»2THEN560\PRINT" POPPED OUT IN SHALLOW LEFT, "VGOTQ840 

560 IFA>3THEN5B0 

570 PRINT" GROUNDED TO THE PITCHER" ? VGOTO590 

580 IFA>4THEN680\PRINT H GROUNDED TO SHORTSTOP"! 

590 PRINT" WHO THREW OUT THE MAN" ? VIFC3»2THEN670 

600 IFB1«0THEN670\IFB2"0THEN630UFB3*0THEN620\PRINT" FORCED HOME," 

610 GQTO850 

620 PRINT" FORCED TO THIRD. "\GOTO850 

630 L£TA1*INT(3*RND(0))\PRINT" FORCED TO SECOND" ? WFA1«MTHEN650 

640 PRINT", "VGOTO850 

650 PRINT\PRINT"AND THEN TO FIRST FOR A DOUBLE PLAYl" 

660 LETC3sC3*l\LETBl»0\GOTO840 

670 PRINT" AT FIRST, "NGOTO840 

680 IFA>5THEN700\PRINT" HIT A FLY INTO DEEP CENTER WHERE IT WAS"? 

690 PRINT" CAUGHT, "\GOTO710 

700 IFA>6THEN880\PRINT" HIT TO LEFT FIELD FOR AN OUT," 

710 IFC3*2THEN8a0\lFBl+B2+B3«0THEN840 

720 PRINT"THE MAN ON" ? VIFB3«1THEN730VIFB2«>1THEN750VGQTO790 

730 PRINT" THIRD MADE IT HOME, " ? VGOSU8930VLETB3s0 

740 IFB2»0THEN780 

750 PRINT" SECOND«?\IFA1*0THEN760\PRINT" STAYED PUT , "\GOTQ780 

760 IFA1MTHEN770SPRINT" MADE IT TO THIRD, "\LETB3b 1 VLETB2=0VGOTO780 

770 PRINT" WAS OUT TRYING TO TAKE THIRD, " VLETC3=C3+1 VLETB2*2 

780 IFB1O1THEN840 

790 IFB2<>1THEN800\PRINT" FIRST STUCK , "VGOTO840 

800 PRINT" ON FIRST" ?VIFB2<>2THEN620 

810 PRINT" MADE IT TO SECOND, "VLETB2M VLETB1«0VGOTQ840 

820 LETW=2*RND(0)UFW>1THEN810\PRINT" WAS OUT GOING, "\LETC3=C3+1 

830 LETB2»0 

840 L£TZ(Y)*Z(Y)»CZ(Y)/100)\GOTO860 

850 LETZCY)*Z(Y)*(Z(Y)/100) 

860 LETC3*C3+1\PRINTWTHAT WAS OUT NUMBER"?C3 

870 GOTO1260 

880 IFA>7THEN890\PRINT" HIT OVER THE PITCHER'S HEAD FOR A"?\GOTO910 

890 IFA>8THEN900\PRINT" HIT THROUGH THE HOLE INTO RIGHT FOR A"?VGOTO910 

900 PRINT" HIT INTO LEFT FIELD FOR A"? 

910 IFZ>4*DTHEN 12 10SIFZ>3*DTHEN 11 30V IFZ>2*DTHEN1 040 VPRINT" SINGLE," 

920 IFB3«0TMEN970VGQSUB930VLETB3*0VGQTQ960 

930 IFS1*1THEN940VLETS3*S3+1VGOTQ950 

940 LETS2»S2*1 

950 LETI2»I2+1VRETURN 

960 PRINT«THE MAN ON THIRD SCORED," 

970 IFB2a0THEN1000VPRINT«THE MAN ON SECOND" ? VIFA>8THEN990VPRINT" SCORED," 

980 GOSUB930VLETB2B0VGOTO1000 

990 PRINT" WENT TO THIRD, "VLETB2»0VLETB3*1 

1000 IF81*0THEN1030VPRINT«THE MAN ON FIRST" ? VIFA>8THEN1020 

1010 IFC2b4THEN1020VLETB1«0VGOTO990 

1020 PRINT" TO SECOND, "VLETB2-1 

1030 LET8131VGQTO1240 

1040 LETW=3*RND(0)V1FW>1THEN1050VPRINT"N OFF THE WALL"? 

1050 IFA2slTHEN1060VPRlNT" STAND UP"? 

1060 PRINT" DOUBLE, "VIFB3b0THEN1080VPRINT«THE MAN ON THIRD SCORED." 

1070 GOSUB930VLETB3*0 

1080 IFB2s0THEN1090VPRlNT«THE MAN ON SECOND SCORED, "VGOSU8930VLETB2s0 

1090 IFB1*0THEN1120VPRINT"THE MAN ON FIRST »? VIFA>8THEN1 1 10VPRINT" SCORED." 

1100 GOSUB930VLETB1P0VGOTO1120 

1110 PRINT" WENT TO THIRD, "VLET B1«0VLET83*1 

1120 LETB2S1VGOTQ1240 

1130 PRINT" TRIPLEl"VLETA3«Bl*B2+B3VIFA3s0THENt200VPRINT"THE MAN ON"? 

1140 IFB1B0THEN1150NPRINT" FIRST" ? VGOSUB930 

1150 IFB2b0THEN1170VIFB1«0THEN1160VPRINT", ANO"? 

1160 PRINT" SECONO"fVGOSUB930 

1170 iFB3s0THENll90VIF8l<*B280THENH80VPRINT", AND"? 

1180 PRINT" THIRO"?VGOSUB930 

1190 PRINT" SCORED, "VLETB1»0VLETB2p0 

1200 LETB3MVGOTQ1240 

1210 IFBl+82+B3<3THENl220VPRlNT" GRAND SLAM"? 

1220 PRINT" HOME RUN J } '• VFQRA1 «1T0 (81 + B2 + 83+1 ) VGQSUB930VNEXTA1 

1230 LETBl«0VLETB2»0VLETB3s0 

1240 IFC284THEN1260VLETZ(Y)"Z(Y)*(Z(Y)/100) 

1250 LETI1«I1+1 

1260 RETURN 

1270 PRINT"PITCHER THROWN OUT FOR THROWING ILLEGAL PITCH, "VGOTO270 

1280 LETAs5*RND(0)VlFA<3THEN1320 

1290 IFA>4THEN1300VPRINT"INSIDE - "?VGOTQ1310 

1300 PRINT»0UTSIDE - «? 

1310 LETC2*C2*1VPRINT"BALL"?C2VGOTO150 

1320 IFZ(Y)<DTHEN1340\GOSU«520VIFA«6THENi330VLETC(Y)8C(Y)+lVGOTO140 

1330 LETC(Y)pC(Y)-1VGOTO140 

1340 LETC(Y)aC(Y)-lVLETB«3*RNDC7) 

1350 IFB>1THEN1360VPRINT«A SWING & A MISS - «?VGOTO1390 

1360 IFB>2THEN1380VPRINT"INSIDE CORNER - CALL " ,* 

1370 GOTO1390 

1380 PRINT«FOULI - " ? VIFC1 »2THEN1400 

1390 LETCl«ClflVPRINT'" STRIKE" ?C 1VGOTO150 

1400 PRINT"COUNT STAYS AT" ?C2? "BALLS AND"fCl? 

1410 PRINT"STRIKES,"VGOTO150 

1420 PRINT"FINA|. SCORE! ME" ?S2? " YQU" ?S3 

1430 IFS2>S3THEN1450VIFS3«S2THEN1«40VPRINT H YOU WON, " VGOTOl 460 

1440 PRINT"A DRAWJ"VGOTO1460 

1450 PRINT"I WONJ" 

1460 CHAIN"DEMON " 

1470 END 



27 



SAMPLE RUN 



RUM 

BASEBL 01:38 PM 16-MAY-73 

WELCOME TO HUISMAN STADIUM FOR TODAY'S GREAT GAME BETWEEN 

THE PDP-8 PANTHERS AMD (YOUR MAME PLEASE) THE ? ftSTS/E ROCKETS 

A HIGHLY PARTISAN CROWD OF 53971 FANS IS ANXIOUSLY AWAITING THE 

START OF THE GAME. 

HERE IS MY TEAM: AND HERE IS YOURS: 

NAME AVERAGE MAME AVERAGE 



HUISMAN 

HOEREM 

BACCUS 

SMITH 

SCHNEIDER 

ROSENBAUM 

POULSEN 

KILGOUR 

JOHNSON 

WHITNEY 



.412001 
.236001 
.241001 
.367001 
.295 201 
.319001 
.295001 
.213001 
.233001 
MANAGER 



PITCHER'S OPTIONS ARE: 

FASTBALL 

BEANBALL 

BRUSHBACK 

BALL 

CURVE 

SLIDER 

KNUCKLE 

GREASE3ALL (ILLEGAL) 

SPITBALL (ILLEGAL) 

CHECK 



KLOOS 


.263001 


ANDREWS 


.316001 


MAYER 


.386001 


HANSEN 


.321001 


MICHEL 


.296001 


P. D. PEATE 


.285001 


WILLIAMS 


.295001 


NELSON 


. 139001 


ANKCORM 


.231001 


IVEY 


MANAGE ft 



YOUR PLAY? KILL 
INSIDE - BALL 3 
YOUR PLAY? SWING 
INSIDE - BALL 2 
YOUR PLAY? KILL 

INSIDE CORNER - CALL STRIKE 1 
YOUR PLAY? HIT-AWAY 
FOUL! - STRIKE 2 
YOUR PLAY? BUNT 

YOUR BATTER GROUNDED TO THE PITCHER WHO THREW OUT THE MAN AT FIRST. 
T HAT WAS OUT NUMBER 1 

YOUR PLAY? BUNT 

YOUR BATTER GROUNDED TO THE PITCHER WHO THREW OUT THE MAN AT FIRST. 

THAT WAS OUT NUMBER 2 

YOUR- PLAY? SWING 

INSIDE CORNER - CALL STRIKE 1 

YOUR PLAY? SWING 

OUTSIDE - BALL 1 

YOUR PLAY? KILL 

OUTSIDE - BALL 2 

YOUR PLAY? GROUNFDER 

INSIDE - BALL 3 

YOUR PLAY? GROUNDER 

YOUR BATTER LINED OUT TO THE THIRD BASEMAN. 

THAT WAS OUT NUMBER 3 



RUNS, HITS, 
I 'M UP NOW. 
SCORE: ME YOU 



ERRORS AND LEFT ON BASE. 



BATTER'S OPTIONS ARE: 

BUNT 

SWING 

HIT-AWAY 

SACRIFICE 

GROUNDER 

FLY 

KILL 



THE PANTHERS ARE TAKING THE. FIELD NOW AS ANDREWS OF THE 

RSTS/E ROCKETS ADVANCES TO THE PLATE. PLEASE WAIT AS THE COMPUTER 5IMGS 

UR NATIONAL ANTHEM TO ITSELF - 2 OR 3 TIMES! JUST SING 

ALONG UNTIL ASKED FOR YOUR PLAY. 

YOUR PLAY? SWING 

YOUR BATTER GROUNDED TO SHORTSTOP WHO THREW OUT THE MAN AT FIRST. 
THAT WAS OUT NUMBER 1 

YOUR PLAY? SWING 

INSIDE - BALL 1 

YOUR PLAY? SWING 

INSIDE - BALL 2 

YOUR PLAY? HIT-AWAY 

INSIDE CORNER - CALL STRIKE I 

YOUR PLAY? KILL 

INSIDE CORNER - CALL STRIKE 2 

YOUR PLAY? KILL 

YOUR BATTER HIT TO LEFT FIELD FOR AN OUT. 

THAT WAS OUT NUMBER 2 

YOUR PLAY? SWING 

OUTSIDE - BALL 1 

YOUR PLAY? KILL 

OUTSIDE / BALL 2 

YOUR PLAY? HIT-AWAY 

YOUR BATTER POPPED OUT IN SHALLOW LEFT. 

THAT WAS OUT NUMBER 3 



RUNS, HITS, 
I 'M UP NOW. 
SCORE: ME YOU 



ERRORS AND LEFT ON BASE. 



YOUR PLAY? FASTBALL 

MY BATTER HIT THROUGH THE HOLE INTO RIGHT FOR A SINGLE. 

YOUR PLAY? FASTBALL 

MY BATTER GROUNDED TO THE PITCHER WHO THREW OUT THE MAN FORCED TO SECOND 
AJD THEN TO FIRST FOR A DOUBLE PLAY! 
THAT WAS OUT NUMBER 2 

YOUR PLAY? CURVE 

MY BATTER HIT TO LEFT FIELD FOR AN OUT. 

THAT WAS OUT NUMBER 3 



AFTER 1 INNINGS RUNS, 1 HITS, 
M)U'RE UP NOW. 
SCORE: ME YOU 



ERRORS AND LEFT ON BASE. 



28 



BASKET 



BASKETBALL GAME VS DARTMOUTH 



Description 



This program simulates a game of basketball between Dartmouth 
College and an opponent of your choice. You are the Dartmouth 
captain and control the type of shot and defense during the 
course of the game. 

There are four types of shots: 1. Long Jump Shot (30 ft.), 
2. Short Jump Shot (15 ft.), 3. Lay Up, and 4. Set Shot. 
Both teams use the same defense, but you may call it: Press (6), 
Man-to-man (6.5), Zone (7), or None (7.5). To change defense, 
type "0" as your next shot. 

Note: The game is biased slightly in favor of Dartmouth. The 
average probability of a Dartmouth shot being good is 62.95% 
compared to a probability of 61.85% for their opponent. 
(This makes the sample run somewhat remarkable in that Cornell 
won by a score of 51 to 35. Hooray for the Big Redl) 

Program Author 

Basketball programs were received from Bill Heuer, Fort Worth, 
Texas; James Bonalumi, Torrington, Conn.; and Alan Segal, 
Roslyn, New York. The one published was written by a then- 
sophomore at Dartmouth in the Class of '70: 



"TT% 



Charles R. Bacheller 
Dartmouth College 
Hanover, NH 03755 



h 



29 



PROGRAM LISTING 



*** TWO MINUTES LEFT IN THE GAME 



5 RANDOMIZE 

10 PRINT "THIS IS DARTMOUTH COLLEGE BASKETBALL, YOU WILL BE DARTMOUTH" 

20 PRINT » CAPTAIN AND PLAYMAKER. CALL SHOTS AS FOLLOWSI 1. LONG" 

30 PRINT " C30 FT.) JUMP SHOT? 2 SHORT C 15 FT,) JUMP SHOT? 3, LAY" 

40 PRINT " UP? 4, SET SHOT," 

60 PRINT "BOTH TEAMS WILL USE THE SAME DEFENSE, CALL DEFENSE AS" 

70PRINT" FOLLOWSI 6 PRESS? 6,5 MAN-TO-MANf 7 ZONE* 7.5 NONE," 

72 PRINT « TO CHANGE DEFENSE, JUST TYPE AS YOUR NEXT SHOT," 

74 PRINT "YOUR STARTING DEFENSE WILL BE"? 

76 INPUT D 

77 IF D<6 THEN 2010 

79 PRINT 

80 PRINT "CHOOSE YOUR OPPONENT »? 
82 INPUT OS 

370 PRINT "CENTER JUMP" 

390 IF RND > 3/5 THEN 420 

400 PRINT OS?" CONTROLS THE TAP," 

410 GO TO 3000 

420 PRINT "DARTMOUTH CONTROLS THE TAP," 

425 PRINT 

430 PRINT "YOUR SHOT" J 

435 LET P30 

440 INPUT Z 

445 IF ZOINT(Z) THEN 455 

446IF ABS(Z-2)>2 THEN 455 

447 GOTO 460 

455 PRINT "INCORRECT ANSWER, RETYPE IT"? 

456 GOTO 440 
460 GO TO 470 

470 IF RND <,5 THEN 1000 
480 IF T<100 THEN 1000 

490 PRINT 

491 IF S(1)<>S(0) THEN 510 

493 PRINT " ***** END OF SECOND HALF *****" 

495 PRINT "SCORE AT END OF REGULATION TIME J" 

496 PRINT " DARTMOUTH" S(l)i OS" "SC0) 

497 PRINT 

498 PRINT "BEGIN TWO MINUTE OVERTIME PERIOD" 

499 LET T«s93 

500 GO TO 370 

510 PRINT " ***** END OF GAME *#***" 

515 PRINT "FINAL SCORE? DARTMOUTH" SCI)? OS" "SC0) 

520 STOP 

600 PRINT 

610 PRINT " 

620 PRINT 

630 RETURN 

1000 IF Zal THEN 1040 

1020 IF Za2 THEN 1040 

1036 GO TO 1300 

1040 LET T«T+l 

1041 IF T=50 THEN 8000 

1042 IF T=92 THEN 1046 

1043 GO TO 1050 
1046 GOSUB 600 
1050 PRINT "JUMP SHOT" 
1060 IF RND >,341*D/8 THEN 1090 
1070 PRINT "SHOT IS GOOD," 
1075 GOSUB 7000 
1085 GO TO 3000 

1090 IF RND >,682*D/8 THEN 1200 
1100 PRINT "SHOT IS OFF TARGET," 
1105 IF D/6*RND>,45 THEN 1130 

1110 PRINT "DARTMOUTH CONTROLS THE REBOUND," 
1120 GO TO 1145 

1130 PRINT "REBOUND TO "?0$?"," 
1137 GO TO 3000 
1145 IF RND>,40 THEN 11S8 
1150 GO TO 1300 
1158 IF D=6 THEN 5100 

1160 PRINT "BALL PASSED BACK TO YOU, "? 
1170 GO TO 430 
1180 IF RND>,9THEN1190 
1185 PRINT "PLAYER FOULED, TWO SHOTS," 

1187 GOSUB 4000 

1188 GO TO 3000 

1190 PRINT "BALL STOLEN, "?OS?"*S BALL," 
1195 GO TO 3000 

1200 IF RND>,782*D/8 THEN 1250 

1210 PRINT "SHOT IS BLOCKED, BALL CONTROLLED BY"? 
1230 IF RND>,5 THEN 1242 
1235 PRINT " DARTMOUTH," 
1240 GO TO 430 
1242 PRINT » "?OS?»,» 
1245 GO TO 3000 

1250 IF RND>, 843*0/8 THEN 1270 
1255 PRINT "SHOOTER IS FOULED, TWO SHOTS," 
1260 GOSUB 4000 
1265 GO TO 3000 

1270 PRINT "CHARGING FOUL, DARTMOUTH LOSES THE BALL," 
1280 GO TO 3000 

1300 LET T*T*1 

1301 IF T = 50 THEN 8000 

1302 IF T*92 THEN 1304 

1303 GO TO 1305 

1304 GOSUB 600 

1305 IF Z»0 THEN 2010 
1310 IF Z>3 THEN 1700 
1320 PRINT "LAY UP," 
1330 IF 7/D*RND>,4 THEN 1360 
1340 PRINT "SHOT IS GOOD, TWO POINTS," 
1345 GOSUB 7000 
1355G0 TO 3000 

1360 IF 7/D*RND>,7 THEN 1500 
1370 PRINT "SHOT IS OFF THE RIM," 
1380 IF RND>2/3 THEN 1415 
1390 PRINT OS?" CONTROLS THE REBOUND," 
1400 GO TO 3000 
1410 

1415 PRINT "DARTMOUTH CONTROLS THE REBOUND," 
1420 IF RND>,4 THEN 1440 
1430 GO TO 1300 

1440 PRINT "BALL PASSED BACK TO YOU,"? 
1450 GO TO 430 

1500 IF 7/D*RND>,875 THEN 1600 
1510 PRINT "SHOOTER FOULED, TWO SHOTS," 
1520 GOSUB 4000 
1530 GO TO 3000 

1600 IF 7/D*RND>,925 THEN 1630 - - 

1610 PRINT "SHOT BLOCKED, "0$?»IS BALL," J U 



1620 GO TO 3000 

1630 PRINT "CHARGING FOUL, DARTMOUTH LOSES THE BALL, « 

1640 GO TO 3000 

1700 PRINT "SET SHOT" 

1710 GO TO 1330 

2010 PRINT "YOUR NEW DEFENSIVE ALLIGNMENT IS"? 

2020 INPUT D 

2030 IF D<6 THEN 2010 

2040 GO TO 425 

3000 LET P«l 

3005 LET T»T+1 

3008 IF T=54 THEN 8000 

3010 IF T»92 THEN 3015 

3012 GO TO 3018 

3015 GOSUB 600 

3018 PRINT 

3020 LET Z1«10/4*RND+1 

3030 IF Zl>2 THEN 3500 

3040PRINT "JUMP SHOT" 

3050 IF 8/D*RND>,35 THEN 3100 

3060 PRINT "SHOT IS GOOD," 

3080 GOSUB 6000 

3090 GO TO 425 

3100 IF 8/D*RND>,75 THEN 3200 

3105 PRINT "SHOT IS OFF THE RIM." 

3110 IF D/6*RND>,5 THEN 3150 

3120 PRINT "DARTMOUTH CONTROLS THE REBOUND," 

3130 GO TO 425 

3150 PRINT OS?." CONTROLS THE REBOUND," 

3160 IF D*6 THEN 5000 

3165 IF RND>„5 THEN 3175 

3168 PRINT "PASS BACK TO " OS?" GUARD," 

3170 GO TO 3000 

3175 GO TO 3500 

3200 IF 8/D*RND>,9 THEN 3310 

3210 PRINT "PLAYER FOULED, TWO SHOTS," 

3220 GOSUB 4000 

3230 GO TO 425 

3310 PRINT "OFFENSIVE FOUL, DARTMOUTH'S BALL" 

3320 GO TO 425 

3500 IF Zl>3 THEN 3800 

3510 PRINT "LAY UP" 

3520 IF 7/D*RND>,413 THEN 3600 

3530 PRINT "SHOT IS GOOD," 

3540 GOSUB 6000 

3550 GO TO 425 

3600 PRINT "SHOT IS MISSED," 

3610 GO TO 3110 

3800 PRINT "SET SHOT" 

3810 GO TO 3520 

4000 REM *FOUL SHOOTING* 

4010 IF PND>,49 THEN 4050 

4020 PRINT "SHOOTER MAKES BOTH SHOTS," 

4030 LET S(l-P)=S(l-P)+2 

4040 GOSUB 6010 

4041 RETURN 

4050 IF RND>,75 THEN 4100 

4060 PRINT "SHOOTER MAKES ONE SHOT AND MISSES ONE," 

4070 LET S(l-P)sS(l-P)+l 

4080 GO TO 4040 

4100 PRINT "BOTH SHOTS MISSED," 

4110 GO TO 4040 

5000 IF RND>,75 THEN 5010 

5005 GO TO 3165 

5010 PRINT "BALL STOLEN, EASY LAY-UP FOR DARTMOUTH," 

5015 GOSUB 7000 

5030 GO TO 3000 

5100 IF RND>,6 THEN 5120 

5110 GO TO 1160 

5120 PRINT "PASS STOLEN BY "?0$?" EASY LAY-UP," 

5130 GOSUB 6000 

5140 GO TO 425 

6000 LET SC0)«S(0)+2 

6010 PRINT "SCORE? " SCI)? "TO " S(0) 

6020 RETURN 

7000 LET SCl)=S(l)+2 

7010 GOSUB 6010 

7 020 RETURN 

8000 PRINT " ***** END OF FIRST HALF *****" 

8010 PRINT"SCOREl DARTMOUTH" SCI)? OS" "SC0) 

8015 PRINT 

8016 PRINT 
8020 GO TO 370 
9999 END 



SAMPLE RUN 



THIS IS DARTMOUTH COLLEGE BASKETBALL. YOU WILL BE DARTMOUTH 
CAPTAIN AND FLAVMAKER. CALL SHOTS AS FOLLOWS: 1. LONG 
<30 FT. > JUMP SHOT; 2 SHORT <15 FT. > JUMP SHOT; 3. LAV 
UP; 4. SET SHOT. 

BOTH TEAMS WILL USE THE SAME DEFENSE. CALL DEFENSE AS 

FOLLOWS : 6 PRESS; 6. 5 MAN-TO-MAN; 7 ZONE; 7. 5 NONE. 
TO CHANGE DEFENSE, JUST TYPE O AS YOUR NEXT SHOT. 

YOUR STARTING DEFENSE WILL BE ?7 

CHOOSE YOUR OPPONENT ''CORNELL 

CENTER JUMP 

CORNELL CONTROLS THE TAP. 

LAY UP 

SHOT IS GOOD. 

SCORE: TO 2 

VOUR SHOT ?2 

JUMP SHOT 

SHOT IS BLOCKED. BALL CONTROLLED BY DARTMOUTH. 

VOUR SHOT ?3 

LAY UP. 

SHOT IS GOOD. TWO POINTS. 

SCORE: 2 TO 2 

SET SHOT 

SHOT IS MISSED. 

DARTMOUTH CONTROLS THE REBOUND. 

VOUR SHOT ?2 
JUMP SHOT 
SHOT IS GOOD. 
SCORE: 4 TO 2 

JUMP SHOT 
SHOT IS GOOD. 
SCORE: 4 TO 4 

VOUR SHOT ?1 

JUMP SHOT 

SHOT IS OFF TARGET. 

DARTMOUTH CONTROLS THE REBOUND. 

BALL PASSED BACK TO YOU. YOUR SHOT ?2 

JUMP SHOT 

SHOT IS GOOD. 

SCORE: 6 TO 4 

SET SHOT 

SHOT IS MISSED. 

DARTMOUTH CONTROLS THE REBOUND. 

VOUR SHOT ?2 
JUMP SHOT 
SHOT IS BLOCKED. 
VOUR SHOT ?1 
JUMP SHOT 
SHOT IS GOOD. 
SCORE: 8 TO 4 

SET SHOT 
SHOT IS GOOD. 
SCORE: 8 TO 6 

VOUR SHOT ?4 

SET SHOT 

SHOT IS OFF THE RIM. 

DRRTMOUTH CONTROLS THE REBOUND. 

BALL PASSED BACK TO YOU. VOUR SHOT ?2 

LAV UP. 

SHOT IS OFF THE RIM. 

DRRTMOUTH CONTROLS THE REBOUND. 

LAV UP. 

SHOT IS GOOD. TWO POINTS. 

SCORE: IS TO 6 

LAV UP 

SHOT IS MISSED. 

CORNELL CONTROLS THE REBOUND. 

LAV UP 

SHOT IS GOOD. 

SCORE: 10 TO 8 

VOUR SHOT ?2 
JUMP SHOT 

SHOT IS OFF TARGET. 
REBOUND TO CORNELL. 

LRV UP 

SHOT IS MISSED. 

DRRTMOUTH CONTROLS THE REBOUND. 

VOUR SHOT ?1 
JUMP SHOT 
SHOT IS GOOD. 
SCORE: 12 TO 8 



BALL CONTROLLED BY DARTMOUTH. 



LRV UP 

SHOT IS GOOD. 

SCORE: 12 TO 



10 



VOUR SHOT ?2 

JUMP SHOT 

SHOT IS OFF TARGET. 

DARTMOUTH CONTROLS THE REBOUND. 

BALL PASSED BACK TO YOU. YOUR SHOT ?4 

SET SHOT 

SHOT IS OFF THE RIM. 

CORNELL CONTROLS THE REBOUND. 



JUMP SHOT 

SHOT IS OFF TARGET. 

DARTMOUTH CONTROLS THE REBOUND. 

LAV UP. 

SHOT IS GOOD. TWO POINTS. 

SCORE: 29 TO 39 

LAY UP 

SHOT IS MISSED. 

CORNELL CONTROLS THE REBOUND. 

LAV UP 

SHOT IS GOOD. 

SCORE: 29 TO 41 

VOUR SHOT ?2 
JUMP SHOT 

SHOT IS OFF TARGET. 
REBOUND TO CORNELL. 

LAV UP 

SHOT IS GOOD. 

SCORE: 29 TO 43 

VOUR SHOT ?4 

SET SHOT 

SHOT IS OFF THE RIM. 

CORNELL CONTROLS THE REBOUND. 

JUMP SHOT 

SHOT IS OFF THE RIM. 

CORNELL CONTROLS THE REBOUND. 

PASS BACK TO CORNELL GUARD. 

LAV UP 

SHOT IS MISSED. 

CORNELL CONTROLS THE REBOUND. 

LAV UP 

SHOT IS MISSED. 

DARTMOUTH CONTROLS THE REBOUND. 

VOUR SHOT ?1 

JUMP SHOT 

SHOT IS BLOCKED. 



BALL CONTROLLED BY CORNELL. 



JUMP SHOT 

SHOT IS OFF THE RIM. 

DARTMOUTH CONTROLS THE REBOUND. 

VOUR SHOT ?1 

*** TWO MINUTES LEFT IN THE GAME *** 

JUMP SHOT 
SHOT IS GOOD. 
SCORE: 21 TO 42 

LAV UP 

SHOT IS GOOD. 

SCORE: 31 TO 45 



VOUR SHOT ?2 
LRV UP. 
SHOT IS GOOD. 
SCORE: 33 TO 

SET SHOT 
SHOT IS GOOD. 
SCORE : 33 TO 



TWO POINTS. 
45 



4? 



VOUR SHOT ?1 

JUMP SHOT 

SHOT IS OFF TARGET. 

DARTMOUTH CONTROLS THE REBOUND. 

LRV UP. 

SHOT IS OFF THE RIM. 

DRRTMOUTH CONTROLS THE REBOUND. 

LRV UP. 

SHOT IS OFF THE RIM. 

CORNELL CONTROLS THE REBOUND. 

SET SHOT 
SHOT IS GOOD. 
SCORE: 33 TO 49 



VOUR SHOT ?3 
LRV UP. 
SHOT IS GOOD. 
SCORE: 35 TO 



TWO POINTS. 
49 



SET SHOT 

SHOT IS MISSED. 

CORNELL CONTROLS THE REBOUND. 

PASS BACK TO CORNELL GUARD. 

JUMP SHOT 
SHOT IS GOOD. 
SCORE: 35 TO 51 

VOUR SHOT ?1 

***** end OF GAME ***** 
FINAL SCORE: DARTMOUTH 25 CORNELL 



LRV UP 

SHOT IS MISSED. 

CORNELL CONTROLS THE REBOUND. 

PASS BACK TO CORNELL GUARD. 

JUMP SHOT 
SHOT IS GOOD. 
SCORE: 12 TO 12 



VOUR SHOT ?3 

LAV UP. 

SHOT BLOCKED. 



CORNELL'S BALL. 



31 



BATNUM 



BATTLE OF NUMBERS 



Description 



The game starts with an imaginary pile of objects, coins for 
example. You and your opponent (the computer) alternately 
remove objects from the pile. You specify in advance the 
minimum and maximum number of objects that can be taken on 
each turn. You also specify in advance how winning is 
defined: 1. To take the last object or 2. To avoid taking 
the last object. You may also determine whether you or the 
computer go first. 

The strategy of this game is based on modulo arithmetic. If 
the maximum number of objects a player may remove in a turn 
is M, then to gain a winning position a player at the end of 
his turn must leave a stack of 1 modulo (M+l) coins. If you 
don't understand this, play 23 Matches (23 MTCH) first, then 
BATNUM, and just have funi 

Program Author 

BATNUM is based on an old game similar to NIM. Its adaptation 
for the computer appears to originally be by the daddy of 
BASIC: 

John Kemeny 
Dartmouth College 
Hanover, NH 03755 




m O 

> CO 

5 c 

5 CO 

> E 
.o w 

r- P 



to o 

= tt> 



PROGRAM LISTING 



SAMPLE RUN 



119 PRINT "THIS PROGRAM IS A 'BATTLE OF NUMBERS'" 

126 PR I NT "GAME, WHERE THE COMPUTER IS YOUR OPPONENT. " 

130 PRINT 

140 PR I NT "THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS. YOU AND" 

156 PR I NT "YOUR OPPONENT ALTERNATLY REMOVE OBJECTS FROM THE PILE. " 

160 PR I NT "WINNING IS DEFINED IN ADVANCE AS TAKING THE LAST OBJECT" 

176 PRINT"OR NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINNING" 

180 PRINT"CONDITIONS. DON'T USE ZERO, HOWEVER, IN PLAYING THE GAME. 

280 PRINT 

210 GOTO 330 

220 FOR 1=1 TO 1© 

230 PRINT 

240 NEXT I 

330 PR I NT "ENTER PILE SIZE:"; 

340 INPUT N * 

350 IF NO© THEN 370 

360 GOTO 330 

370 IF NOINT<N> THEN 220 

380 IF N<1 THEN 220 

390 PRINT "ENTER WIN OPTION - 1 TO TAKE LAST, 2 TO AVOID LAST: "; 

480 INPUT M 

410 IF M=l THEN 430 

420 IF M<>2 THEN 39© 

430 PRINT "ENTER MIN AND MAX: "; 

440 INPUT A, B 

450 IF A>B THEN 430 

460 IF A<1 THEN 430 

470 IF flOINT(fl) THEN 43© 

480 IF BOINT<B> THEN 430 

490 PRINT"ENTER START OPTION - 1 COMPUTER FIRST, 2 YOU FIRST:"; 

580 INPUT S 

510 IF S=l THEN 530 

520 IF S<>2 THEN 49© 

530 LET C=A+B 

546 IF.S=2 THEN 570 

550 GOSUB 60© 

560 IF W=l THEN 220 

570 GOSUB 810 

580 IF W=l THEN 220 

590 GO TO 550 

600 LET Q=N 

610 IF M=l THEN 63© 

620 LET 0=Q~1 

630 IF M=l THEN 68© 

640 IF N>A THEN 72© 

650 LET W=l 

669 PRINT"COMPUTER TAKES"; N; "AND LOSES. " 

670 RETURN 

680 IF N>B THEN 72© 

690 LET W=l 

700 PRINT"COMPUTER TAKES"; N; "AND WINS. " 

710 RETURN 

720 LET P=0-C*INT<0/C> 

730 IF P>=A THEN 75© 

740 LET P=A 

75© IF PO'B THEN 77© 

76© LET P=B 

770 LET N=N-P 

78© PRINT"COMPUTER TAKES"; P; "AND LEAVES"; N 

790 LET W=0 

800 RETURN 

810 PRINT "YOUR MOVE: "; 

820 INPUT P 

830 IF PO0 THEN 87© 

84© PRINT"I TOLD YOU NOT TO USE ZERO. .. COMPUTER WINS BY FORFEIT. " 

850 LET W=l 

860 RETURN 

870 IF POINT<P> THEN 920 

880 IF P>=A THEN 91© 

890 IF P=N THEN 960 

900 GO TO 920 

910 IF P<=6 THEN 94© 

920 PRINT "ILLEGAL MOVE, REENTER IT: "; 

930 GO TO 820 

940 LET N=N-P 

95© IF NO0 THEN 1©3© 

96© IF M=l THEN 106© 

970 PR I NT "TOUGH LUCK, YOU LOSE. " 

980 LET W=l 

990 RETURN 

100© PRINT"CONGRATLILflTIONS, YOU WIN. " 

1010 LET W=l 

1020 RETURN 

1030 IF N>=0 THEN 1©6© 

104© LET N=N+P 

1050 GO TO 920 

1060 LET W=0 

1078 RETURN 

1080 END 



THIS PROGRAM IS A 'BATTLE OF NUMBERS' 
GAME, WHERE THE COMPUTER IS YOUR OPPONENT. 

THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS. YOU AND 

VOUR OPPONENT ALTERNATLY REMOVE OBJECTS FROM THE PILE. 

WINNING IS DEFINED IN ADVANCE AS TAKING THE LAST OBJECT 

OR NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINNING 

CONDITIONS. DON'T USE ZERO, HOWEVER, IN PLAYING THE GAME. 



ENTER PILE SIZE: ?23 

ENTER WIN OPTION - 1 TO TAKE LAST, 

ENTER MIN AND MAX: ?l/3 

ENTER START OPTION - 1 COMPUTER FIRST 

VOUR MOVE: ?2 

COMPUTER TAKES 1 AND LEAVES 2© 

VOUR MOVE: ?3 

COMPUTER TAKES 

VOUR MOVE: ?3 

COMPUTER TAKES 

VOUR MOVE: ?3 

COMPUTER TAKES 

VOUR MOVE: ?3 

COMPUTER TAKES 

VOUR MOVE: ?3 

COMPUTER TAKES 



TO AVOID LAST: 
2 YOU FIRST: 



1 AND LEAVES 16 



1 AND LEAVES 12 
1 AND LEAVES 8 



1 AND LEAVES 4 
1 AND LOSES. 



ENTER PILE SIZE: ?23 

ENTER WIN OPTION - 1 TO TAKE LAST, 2 TO AVOID LAST: ?2 

ENTER MIN AND MAX: ?1, 3 

ENTER STflRT OPTION - 1 COMPUTER FIRST, 2 YOU FIRST: ?1 

COMPUTER TAKES 2 AND LEAVES 21 

VOUR MOVE: ?3 

COMPUTER TAKES 1 AND LEAVES 17 

VOUR MOVE: ?2 

COMPUTER TAKES 2 AND LEAVES 13 

VOUR MOVE: ?1 

COMPUTER TAKES 3 AND LEAVES 9 

VOUR MOVE: ?1 

COMPUTER TAKES 3 AND LEAVES 5 

VOUR MOVE: ?3 

COMPUTER TAKES 1 AND LEAVES 1 

VOUR MOVE: ?1 

TOUGH LUCK, YOU LOSE. 



ENTER PILE SIZE: ? 

ENTER WIN OPTION - 

ENTER MIN AND MAX: 

ENTER START OPTION 

VOUR MOVE: ?2 

COMPUTER TAKES 1 AND LEAVES 24 

VOUR MOVE: ?4 

COMPUTER TAKES 1 AND LEAVES 19 

VOUR MOVE: ?4 

COMPUTER TAKES 1 AND LEAVES 14 

VOUR MOVE: ?4 

COMPUTER TAKES 1 AND LEAVES 9 

VOUR MOVE: ?4 

COMPUTER TAKES 1 AND LEAVES 4 

VOUR MOVE : ?4 

CONGRATULATIONS, YOU WIN. 



TO TAKE LAST, 2 TO AVOID LAST: 
?1, 4 
1 COMPUTER FIRST, 2 YOU FIRST: 



33 



BATTLE 



NAVAL SHIP BATTLE 

Description 

This description is an adaptation of the one written by Ray 
Westergard, the program author. 

"BATTLE is based on the popular game Battleship which is 
primarily played to familiarize people with the location 
and designation of points on a coordinate plane." 

BATTLE first randomly sets up the bad guys' fleet disposition 
on a 6 by 6 matrix or grid. The fleet consists of six ships: 
Two destroyers (ships number 1 and 2) which are two units long, 
two cruisers (ships number 3 and 4) which are three units long 
and two aircraft carriers (ships number 5 and 6) which are 
four units long. The program then prints out this fleet dis- 
position in a coded or disguised format (see the sample com- 
puter print-out) . You then proceed to sink the various ships 
by typing in the coordinates (two digits, each from 1 to 6, 
separated by a comma) of the place where you want to drop a 
bomb, if you'll excuse the expression. The computer gives 
the appropriate responses (splash, hit, etc.) which you should 
record on a 6 by 6 matrix. You are thus building a representa- 
tion of the actual fleet disposition which you will hopefully 
use to decode the coded fleet disposition printed out by the 
computer. Each time a ship is sunk, the computer prints out 
which ships have been sunk so far and also gives you a 
"SPLASH/HIT RATIO". 

The first thing you should learn is how to locate and designate 
positions on the matrix, and specifically the difference between 
"3,4" and "4,3". Our method corresponds to the location of 
points on the coordinate plane rather than the location of 
numbers in a standard algebraic matrix: The first number gives 
the column counting from left to 'right and the second number 
gives the row counting from bottom to top. 

The second thing you should learn about is the splash/hit ratio. 
"What is a ratio?" A good reply is "It's a fraction or quotient." 
Specifically, the splash/hit ratio is the number of splashes 
divided by the number of hits. If you had 9 splashes and 15 
hits, the ratio would be 9/15 or 3/5, both of which are correct. 
The computer would give this splash/hit ratio as .6. 

One of the main objects and primary educational benefits of 
BATTLE comes from attempting to decode the bad guys' fleet 
disposition code. To do this, you must make a COMPARISON 
between the coded matrix and the actual matrix which you con- 
struct as you play the game. 

Program 

Ray Westergard 
Lawrence Hall of Science 
University of California ~ 4 
Berkeley, CA 94700 




PROGRAM LISTING 



10 REM -• BATTLE WRITTEN By RAy WESTERGARD 10/70 

20 REM COPyRIGHT 1971 By THE REGENTS OF THE uNIy. OF CALIF, 

30 rem Produced at the Lawrence hall of science, Berkeley 

40 DIM F[6,6J ,H[6,6) ,A[4] ,B[43 ,C(6) ,Lf33 

50 MAT F»ZER 

60 FOR !■! TO 3 

70 N»4*I 

80 FOR J*l TO 2 

90 A«INTC6*RND(0))+i 

100 B«XNT(6*RNO(0))*1 

110 D«INT(4*RNDC0))+1 

120 IF F£A,B3>0 THEN 90 

130 M«0 

140 GOTO D OF 150,340,550,740 

150 B[13*B 

160 8t23»Bt3J«7 

170 FOR Kit TO N 

180 IF M>1 THEN 240 

190 IF BtK3»6 THEN 2j0 

200 IF FtA,B [K]+i3>0 THEN 230 

210 B[K + i3«B[K3+l 

220 GOTO 280 

230 M«2 

240 Z"((B[13 MlN B [23 J mIm B [33 3 

250 iF Z"l THEN 90 

260 if Fl*#Z-l]>0 THfcN 90 

270 BlK*i]«Z»l 

280 NEXT K 

290 FtA,B3*9-2*I»J 

300 FOR K»i TO N 

310 F[A,B[K + i33*FCA,B3 

320 NEXT K 

330 GOTO 990 

340 A [13 >A 

350 Btl3«B 

360 At2] 8 AC33«Bt2J.8[3) 8 

370 FOR K«l TO N 

380 IF M>1 THEN 460 

390 IF A[K]*i OR BCKlsi THEN 450 

400 IF F[A [K]-l,B[Kj-lj>0 THEN 450 

410 IF F[A[Kj*l f B[K]]>0 AND F [A [Kj -1 , B [Kj J "F [A [K] , B •[«] m\ y THEN 450 

420 A[K*13*A [K]-l 

430 B lK*U «B (K] -1 

440 GOTO 530 

450 Ma2 

460 Zl ■ C C A [ 1 ] MAX A tgl ) MAX A C3I ) 

470 Z2»C CB EiJ MAX B [23 D MAX B [33 3 

480 IF Zl«6 OR" Z2*6 THEN 90 

490 IF F[zl+l,z2+l]>0 THEN 90 

500 IF F[Z1,Z2*13>0 AND F [Zl , Z2 + 1 3 «F [Zl + 1 , Z2] T H EN 90 

510 A[K + 13*Z1 + 1 

520 BtK + 13*Z2+l 

530 NEXT K 

548 GOTO 960 

550 Atll»A 

560 A[2]?A[3]*7 

570 FOR K«l TO N 

580 IF M>1 jHEN 640 

590 IF A [K]«6 THEN 630 

600 IF F [A [K3+1,B]>0 THEN 630 

610 A[K + i3«A[K3+l 

620 GOTO 680 

630 -M*2 

640 Z«C(Atl3 MIM A [21) MIM A [33 3 

650 IF Z«l THEN 90 

660 IF FtZ-i,B3>0 THEN 9 

670 A[K + 13«Z-1 

680 NEXT K 

690 F [A,B3 »9-2*I-J 

700 for k»i to'-n 

710 FfA [K+U ,Bj*FtA,B3 

720, .NEXT, K : 

730 GOTO 990 

740 Atl3»A 

750 B [ 1 3 « B 

760 ■ A'!2)"Af3j«7 

770 B[23»B[33 *0 

780 FOR K»l TO N 

790 IF M>1 THEN 870 

800 IF A[K]a6 OR 6[K3sl THEN 86(7! 

810 IF FtA[K3+l,B[K3-U>0 THEN R60 

820 IF F [AfK3*i,B[K3 3>0 AND F [A [K1 +1 , B [Kl 3 «F [A [K3 ,B t K 3 -1 3 THEN 860 

830 A [K + 13 "A tK3 

840 B[K + 13*B[K]«1 

850 GOTO 940 

.860 M»2 

870 Z 1 « f C A [ 1 J MlN A [23) MlN A [33 ) 

880 Z2*(CB[1] MAX B [23 3 MAX B [33 3 

890 IF Zi"l OR Z2«6 THEN 90 

900 IF FtZlfi,Z2+lJ>0 THEN 90 

910 IF F[Zi,Z2+l)>0 AND F[Z1,Z2+13 «FtZl-l,Z2] THEM g0 

920 A[K + i3 «Zi-i 

930 BCK + l3«Z2*l 

940 NEXT K 

950 F[A,B3s9-2*I-J 

960 FOR KM TO N 

970 FtAtK + 13 ,B[K + l]J»FtA,BJ 

980: M E XT' K 

990 NEXT J. 
1000 NEXT I 
1010 PRINT 

1020 PRINt "THE FOLLOWING CODE OF THE BAD GuYS' FLEET .DIsPQsItION* . 
1030 PrINj mhAs been captured But *Ot DE-CODEDi" 
1040 PRINT 
1050 M AJ H«TRN(E) 
1060 MAT PRINT Hi 
1070 PRINT 

1080 PRINT "DE-CODE IT AND USE IT IF YOU CAN" 
1090 PRINT "BUT KEEP THE DECODING METHOD A SECRET," 
1100 PRINT 
1110 MAT H«ZER 
1120 MA T L*ZER 
1130 C [13 "C [23 «2 
1140 c(3]»CC4]»l 
1150 CC53.C t63.0 
1160 S«Hb0 



1170 PRINT "START GAME" 

1180 INPUT X,Y 

1190 IF x<i OR x>6 OR INT ( X ) #ABS ( X ) THEN 1210 

1200 IF y>0 AN y*T A ND INt(Y3«ABS(y) THEN 1230 

1210 print "invalid input, try again," 

1220 GOTO 1180 

1230 R"7-Y 

1240 CiX 

1250 IF F[R,C3>0 THEN 1290 

1260 S"S+1 

1270 PRINT "SPLASH1 TRY AGAIN," 

1280 GOTO 1180 

1290 IF C[F[R,C33<4 tMEN 1340 

1300 PRINT "THERE USED TO BE A SHIP AT THAT POINT, BUT YOU SUNK IT, 

1310 PRINT "SPLASHJ TRY AGAIN," 

1320 S*S + 1 

1330 GOTO 1180 

1340 IF H[R,C3>0 THEN 1420 

1350' H-H + l ■■■■■'■■. 

1360 H[R,CJ»F[R,C3 

1370 PRINT "A DIRECT HIT ON SHIP NUMBER"! FIR, C) 

1380 C[F[R,C33«C[F[R,C33+1 

1390 IF C[F[R,C3) >■ 4 THEN 1470 

1400 PRINT "TRY AGAIN," 

1410 GOTO 1180 

1420 print "you haye already put a hole in ship nymber" i f [r, c3 i 

1430 Print »at that point," 

1440 print "splashj try again," 

1450 8 B S+1 : 

1460 GOTO 1180 

1470 L IINT((FCR# C3 -13/2) + 13 «LtINTC(F[R, C3-1 3/23 + 13+1 

1480 PRINT "AND YOU SUNK IT, HURRAH FOR THE GOOD GUYS." 

1490 PRINT "SO FAR THE BAD GUYS HAVE LOST" 

1500 PRINT Ltl) ;«DESTRQYER(S), "> L [23 I "CRUISER (S) , AND "I 

1510 PRINT L[3] ^"AIRCRAFT CARPIER(53," 

1520 PRINT "YOUR CURRENT SPLASH/HIT RATIO IS"JS/H 

1530 IF (L[l]+L[2]+L[33 )<6 THEN 1180 

1540 PRINT 

1550 PrINt "YOu HAyE TOTALLY WIPED OyT THE BAD GuYS' FLEET" 

1560 PRINT "WITH A FINAL SPLAsH/HlT RATIO qF"JS/H 

1570 IF S/H>0 THEN 1590 

1580 PRINT "CONGRATULATIONS — A DIRECT HIT EVERY TIME," 

1590 PRINT 

1600 PrINt «+***+*#*+*+********" 

1610 PRINT 

1620 goto 50 

1630 END 



SAMPLE RUN 

THE FOLLOWING CODE OF THE BfiD GUVS' FLEET DISPOSITION 

HAS BEEN CAPTURED BUT NOT DECODED 

3 11 

3 6 

3 2 6 6 6 6 

4 Q 2 @ @ 
4 5 5 5 5 @ 



DE-CODE IT AND USE IT IF VOU CAN -/ X 'X - 
BUT KEEP THE DECODING METHOD A SECRET 

start game--'- V: r - ■::,;. 

?2/i --'"'* --.■-:...- 

SPLASH! TRV RGFlIN. 
?S, 4 

a Direct hit on ship number 5 
trv again. 

?2,-7' ' ' : -.'." ■' •.-. ..-■■--... ■ ■.-,...'■•''•. . - • ' . 

INVALID INPUT. TRV AGAIN. 

?5,3 ' 

A DIRECT HIT ON SHIP NUMBER 5 •■-•'....,.■ 

TRV AGAIN. 
; ?5V:4 - 

VOU HAVE ALREADY PUT A HOLE IN SHIP NUMBER 5 

AT THAT POINT. SPLASH! TRV flGRIN. 
:-?5,..'5-- .: ';■.-.■,.,.. .,.,,.. ... 

:R DIRECT HIT ON SHIP NUMBER 5 : ' 

TRV AGAIN. • 
.; ?5>Z : : . ■ ' , -;.--' 

A DIRECT HIT ON SHIP NUMBER 5 X 

AND VOU SUNK IT. HURRAH FOR THE GOOD GUVS. SO FAR THE BAD GUVS HAVE LOST 
0: DESTROVER<S>, © CRUISER S> AND i ^ilRCRAFT* CARRIER<S>. 

VOUR CURRENT SPLASH/HIT RATIO IS .5 , 

?±-,'l\ ' - "■.' \ ' ..., ; : 

; A DIRECT HIT ON SHIP NUMBER 1 , 

TRV AGAIN. 
i 1±,Z ■■-■: ' ' ■-*- ; --" ' ■' -■ ■-■.-■■: ■-: "<*■■■ 

A DIRECT HIT ON SHIP NUMBER 1 ' 

AND VOU SUNK IT. HURRAH FOR THE GOOD GUVS, SO FAR THE BAD GUVS HAVE: LOST 
1 DESTROVER<S>, 8 CRUISER<S) AND 1 ^ AIRCRAFT CARRIERXS). 

VOUR CURRENT SPLASH/HIT RATIO IS .333333 

?6,.l ........ 

SPLASH! TRV AGAIN. 
V?l> 6 : ' " ■• /.-■■■■'.-'. '•■■■■' -.. '..-- ."■'•v ■:-••■ ■: -„■■■; •-. • 

A DIRECT HIT ON SHIP NUMBER 3 

TRV AGAIN. 

72, 6 

A DIRECT HIT ON SHIP NUMBER 3 

TRV AGAIN. 

72, 6 

A DIRECT HIT ON SHIP NUMBER 3 

AND VOU SUNK IT. HURRAH FOR THE GOOD GUVS. SO FAR THE BAD GUVS HAVE LOST 
1 DESTROYER <S), 1 CRUISER<S) AND 1 AIRCRAFT CARRIER* S). 

VOU CURRENT SPLASH/HIT RATIO IS .375 



35 



BINGO 



COMPUTER BINGO 



Description 



In this game you and the computer play a game of bingo. The 
computer first generates a bingo card for both you and itself, 
It then spins the number drum and draws numbers at random 
which it posts on "the board." It's up to you to play both 
your card and the card of the computer (a second person can 
play this card if you wish) . 

The computer checks for BINGO on both cards, so don't try to 
cheat 1 

Source 

Sorry folks — the author and source are totally unknown. 
It showed up on an in-plant DIGITAL DECsystem-10 quite 
mysteriously one day last year. 



BINGO BINGO BINGO 



(1 TO 13) (UTO30) (31 TO 43) (46 TO 40) (41 TO 75) 



^ 


ie- 


«. 


«N 


P 


5 


24 


33 


60 


68 


8 


29 |H 49 


64 


14 


17 


37 


52 


66 


12 


18 


38 


53 


67 



(I TO IS) (14 TO 30) (31 TO 45) (46 TO 60) (61 TO 75) 



10 


f 


39 


48 


68 


7 


J 


40 


53 


72 


15 


oil 1 £1 


67 


4 


i 


41 


54 


74 


1 


~£ 


31 


57 


69 



(1TOI3) (16 TO 30) (3TT0 4S) (46 TO 60) (41 TO 7$) 



4 


19 


32 


47 




8 


22 


42 




69 


10 


18JP148 


72 


6 




40 


50 


67 


30 


44 


49 


65 



HORIZONTAL (ROW) VERTICAL CCOLUtAU} 



DtAGONAV. 



36 



PROGRAM LISTING 



100 RANDOMIZE 

120 PRINT"Y0U ARE NOW GOING TO PLAY A COMPUTERIZED VERSION OF BINGO--" 

180 LET F«l 

190 DIM B(10,10) 

200 DIM L(75) 

210 MAT READ AS(5) 

220 DATA B ,1 ,N ,G ,0 

235 REM THIS SEQUENCE GENERATES THE CARD NUMBERS (LINES 240-430) 

240 FOR Kl-1 TO 75 

250 LET L(K1)b0 

260 NEXT Kl 

270 PRINT" "," HERE IS "l 

280 IF F>1 THEN 310 

290 PRINT"YQUR CARD" 

300 GOTO 320 

310 PRINT"MY CARD" 

320 LET M*16 

330 LET G=F + 4 

340 FOR Y«F TO G 

350 FOR X«F TO G 

360 LET R»INT(M*RND) 

370 IF R<M-15 THEN 360 

380 IF L(R)<>0 THEN 360 

390 LET B(X,Y)=R 

400 LET L(R)»1 

410 NEXT X 

420 LET MbM+15 

430 NEXT Y 

435 REM THIS SEQUENCE PRINTS THE CARD (LINES 440-670) 

440 PRINT 

450 PRINT»--B--"»«--I-«",»--N--","--G--»,"--G--" 

460 FOR X*F TO G 

470 PRINT 

480 PRINT 

490 PRINT 

500 FOR ¥sF TO G 

510 IF B(X>Y)»B(F+2,r+2) THEN 540 

520 PRINT B(X#Y)» 

530 GOTO 550 

540 PRINT"FREE", 

550 NEXT Y 

560 NEXT X 

570 PRINT 

580 PRINT 

590 PRINT 

600 PRINT" -------------------------------------------------------------- 

610 PRINT" [TEAR OFF AFTER MACHINE AUTOMATICALLY ADVANCES PAPER]" 

620 FOR K9 = l TO 9 

630 PRINT 

640 NEXT K9" 

650 IF F«6 THEN 680 

660 LET F=6 

670 GOTO 240 

680 PRINT 

690 PRINT "MOW WE'RE ALL SET TO PLAY THE GAME, USE A PENCIL TO MARK OFF" 

700 PRlNT"THE NUMBERS ON YOUR. CARD AS THEY ARE CALLED," 

710 PRINT" (PLEASE PLAY MY CARD AS WELL AS YOUR OWN)" 

720 PRINT"***D0N'T GET SMART, I'LL BE PLAYING BOTH YOUR CARD AND MINE" 

730 PRINT " UP HERE IN BOSTON, (SO THERE--)" 

740 PRINT 

750 PRINT "ARE YOU READY"; 

760 INPUT RS 

770 IF RSO»N0» THEN 820 

780 PRINT 

790 PRINT"*********IHURRY UP S »*•*******» 

800 GOTO 740 

810 REM 

820 FOR Kl = l TO 75 

830 LET L(K1)»0 

840 NEXT Kl 

850 PRINT 

860 LET BC3,3)=0 

870 LET B(8,8)=0 

875 REM THIS SEQUENCE GENERATES THE BINGO NUMBERS (LINES 880-1100) 

880 LET UslNT(75#RND)+l 

910 IF L(U)<>0 THEN 880 

920 LET LCU)«i 

930 PRINT 

940 IF RND > ,5 THEN 970 

950 PRINT"THE NUMBER COMES UPS", 

960 GOTO 980 

970 PRINT"THE NEXT ONE ISJ", 

980 PRINT AS(INT((U-i)/l5)+l))U 

1105 REM THIS IS THE "NUMBER ON CARD?" SEQUENCE (LINES 1110-1260) 

1110 FOR Y=l TO 10 

1120 FOR X»l TO 10 

1130 IF B(X,Y)=U THEN 1250 

1140 NEXT X 

1150 NEXT Y 

1160 LET F=l 

1170 GOSUB 1270 

1180 LET F»6 

1190 GOSUB 1270 

1200 IF V=0 THEN 1230 

1210 IF W«l THEN 1980 

1220 GOTO 2050 

1230 IF W«0 THEN 880 

1240 GOTO 2120 

1250 LET B(X,Y)=0 

1260 GOTO 1140 

1265 REM THIS IS THE BINGO DETERMINING SEQUENCE (LINES 1270-1950) 

1266 

1267 REM THIS IS THE VERTICAL CHECK FOR BINGO*** (LINES 1270-1430) 

1270 LET GsF+4 

1280 FOR Y*F TO G 

1290 FOR XbF TO G 

1300 IF B(X,Y)<>0 THEN 1430 

1310 IF X<F + 4 THEN 1420 

1320 IF F»6 THEN 1370 

1330 PRINT 

1340 PRINT"YOU'VE GOT A BINGO***" 

1350 LET W=l 

1360 RETURN 

1370 PRINT 

1380 PRINT"I'VE GOT A BINGO*****" 

1390 LET V»l 

1410 GO TO 1450 

1420 NEXT X 

1430 NEXT Y 

1440 REM THIS IS THE HORIZONTAL CHECK FOR BINGO*** (LINES 1450-1610) 



1450 


LET G»F+4 


1460 


FOR X*F TO G 


1470 


FOR Y«F TO G 


1480 


IF B(X,Y)<>0 THEN 1610 


1490 


IF Y<F*4 THEN 1600 


1500 


IF Fb6 THEN 1550 


1510 


PRINT 


1520 


PRINT«YOU'VE GOT A BINGO** *» 


1530 


LET W»l 


1540 


RETURN 


1550 


PRINT 


1560 


PRINT"I'VE GOT ABINGO*****" 


1570 


LET vm 


1590 


GOTO 1620 


1600 


NEXT Y 


1610 


NEXT X 


1615 


REM THIS IS THE SLANT CHECK (M*-l) FOR BINGO*** (LINES 1620-1770) 


1620 


LET X«F 


1630 


LET Y»F 


1640 


IF B(X,Y)<>0 THEN 1770 


1650 


LET X«X+1 


1660 


LET YhY+1 


1670 


IF Y<F+5 THEN 1640 


1680 


IF Ysll THEN 1740 


1690 


LET Wal 


1700 


PRINT 


1710 


PRINT "YOU'VE GOT A BINGO***" 


1730 


RETURN 


1740 


PRINT"! 'VE GOT A BINGO*****" 


1750 


LET V*l 


1770 


RETURN 


1775 


REM THIS IS THE SLANT CHECK (M=l) FOR BINGO*** (LINES 1780-1950) 


17 80 


LET X»F + 4 


1790 


LET Y»X 


1800 


IF B(X,¥)<>0 THEN 1950 


1810 


LET XaX-1 


1820 


LET Y»Y+1 


1830 


IF Y<F+5 THEN 1800 


1840 


IF Yall THEN 1900 


1850 


PRINT 


1860 


PRINT"YOU'VE GOT A BINGO***" 


1870 


LET W=l 


1890 


RETURN 


1900 


PRINT 


1910 


PRINT"I'VE GOT A BINGO*****" 


1920 


LET V=l 


1950 


RETURN 


1970 


REM THIS THE TIE PRINTOUT SEQUENCE 


1980 


PRINT 


1990 


PRINT" **#«******* IT'S A TIE »*####**#•»#" 


1995 


REM THIS IS THE "PLAY AGAIN?" SEQUENCE 


2000 


PRINT- 


2010 


PRINT "DO YOU WANT TO PLAY AGAIN" | 


2020 


INPUT E$ 


2025 


PRINT 


2030 


IF ESs'tYES" THEN 180 


2040 


STOP 


2045 


REM THIS IS THE "I WIN" SEQUENCE 


2050 


PRINT 


2060 


FOR S*l TO 6 


2070 


PRINT«I WIN. "» 


2080 


NEXT S 


2090 


PRINT 


2100 


PRINT 


2110 


GOTO 2000 


2115 


REM THIS IS THE "YOU WIN" SEQUENCE 


2120 


PRINT 


2130 


PRINT" YOU WIN,,,,, YOU WIN , YOU WIN,,,,,,," 


2140 


GOTO 2000 


2145 


REM THIS IS THE "END" OF THE LIST OF PROGRAM ENTITLED "BINGO" 


2150 


END 



37 



SAMPLE RUN 



VOU ARE NOW GOING TO PLAY ft COMPUTERIZED VERSION OF BINGO—. 
HERE'S VOUR CARD 



NOW WE'RE FILL SET TO PLftV THE GAME. USE ft PENCIL TO MARK OFF 
THE NUMBERS ON VOUR CftRD ftS THEV ftRE CALLED. 
<PLERSE PLftV MV CftRD ftS WELL ftS VOUR OWN) 
***DON'T GET SMART. I'LL BE PLfiVING BOTH VOUR CftRD AND MINE 
UP HERE IN BOSTON. <SO THERE—) 

ARE VOU READY ?VES 



ETEftR OF.F AFTER MACHINE ftUTOMftTICftLLV ftDVftNCES PAPER 3 



HERE'S MV CARD 



[TEAR OFF AFTER MACHINE AUTOMATICALLY ADVANCES PAPER 3 



THE NUMBER COMES UP 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NUMBER COMES UP 

THE NUMBER COMES UP 

THE NUMBER COMES UP 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NUMBER COMES UP 

THE NUMBER COMES UP 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NEXT ONE IS 

THE NUMBER COMES UP 

THE NEXT ONE IS: 

THE NUMBER COMES UP 

THE NUMBER COMES UP 

THE NUMBER COMES UP 

THE NEXT ONE IS: 

THE NUMBER COMES UP 

THE NEXT ONE IS: 

THE NEXT ONE IS: 

THE NUMBER COMES UP 

YOU'VE GOT A BINGO * * * 

VOU WIN. . . . . VOU WIN YOU WIN. 

DO VOU WANT TO PLAY AGAIN ?NO 



G 


58 


I 


20 


I 


29 


B 


6 


G 


51 


B 


3 


N 


37 


G 


59 


B 


14 


I 


21 





?1 





62 





70 


N 


36 


N 


31 


I 


30 


I 


18 


B 


11 





66 


N 


32 





75 


B 


8 


N 


38 


B 


2 


B 


12 


I 


17 


N 


45 


G 


49 


G 


46 


B 


5 





72 


B 


1 



38 



BLKJAK 



GAME OF BLACKJACK 



Description 



This is a simulation of the game of blackjack or 21, Las Vegas 
style. This is one of the more comprehensive versions of black- 
jack which allows splitting your hand if the first two cards 
are the same. Also/ the dealer will ask for an insurance bet 
if he has an exposed ace. The house limit is $500.00. 

Source 

A number of versions of this program were submitted. Ira Gold- 
stein of Fort Worth, Texas, submitted a particularly interesting 
version which uses a second chained program (DECK) to shuffle 
the cards. Two versions are printed here — one written and 
modified by a number of DIGITAL personnel for RSTS-11 and 
another written by students at the Oregon Museum of Science 
and Industry and slightly modified at DIGITAL. 



BLKJAC: 

Digital Equipment Corp, 
Maynard, MA 01754 



BLKJAK: 

Tom Kloos 

Oregon Museum of Science 

and Industry 
Portland, Oregon 97200 




© 1 967 by Creative Publications 



39 



BLKJAC 



PROGRAM LISTING 



110 

115 
120 
125 
130 
135 
140 
145 
150 
155 
16 



10 PRINT "DO YOU WANT INSTRUCTIONS (IF SO TYPE A 1)"; 
15 INPUT K 
25 IF K<>1 THEN 85 
30 PRINT 
PRINT 
PRINT 
PRINT 

PRINT«THIS IS A GAME OF BLACKJACK, LAS- VEGAS STYLE." 
PRINT«HERE ARE THE RULES OF THE HOUSE. THE DEALER" 
PRINT"MUST HIT ON 16 OR LESS AND WILL STAY ON 17 OR" 
PRlNT"MORE. YOU MAY SPLIT TWO CARDS IF THEY ARE THE" 
PRlNT"SAME AND PLAY ONE HAND WITH EACH OF THEM. ALSO?" 
PRlNT"YOU MAY DOUBLE YOUR SET AND RECEIVE EXACTLY ONE " 
PRINT"M0RE CARD ANY TIME ON YOUR FIRST HIT, THE TYPING" 
PRlNT"lNSTRUcTlONS AR E » 0-NO HIT; 1-HITI 2-DOUbLE* ANp" 
90 PRINT "3-SPLIT A PAIR." 
95 IF K<> 1 THEN 155 

100 PRINT"WHEN THE DEALER HAS AN EXPOSED ACE HE WILL ASK" 
105 PRINT"YOU FOR AN INSURANCE BET, AN INSURANCE BET WILL" 

PRINT«RISK HALF YOUR BET FOR AN AMOUNT EQUAL TO YOUR BET" 
PRINT«IF YOU WIN, YOU WIN IF THE DEALER HAS A BLACKJACK" 
PRINTMND LOSE IF HE DOESN'T, THE HOUSE LIMIT IS $500.00" 
PRIN T "GOOD LyCK, OH, By T h E wAy, THE DEALER IS NOyED FOR" 
PrIN t «DEALING OFF tHE BOTTOM OF T HE DECK, wAyCH HIM, yERY" 
PRINT"CL0SELY, HERE HE IS N ow ,« 
PRINT 
PRINT 
PRINT 
LET K«0 
LET wl«0 
165 RANDOMIZE 

170 LET N«INT(1945*RND(0)+1) 
175 PRINT 

180 PRINT»ANY TIME YOU WANT ME TO RESHUFFLE THE CARDS SIMPLY" 
185 PRINT»TYPE 7777 WHEN I ASK FOR YOUR WAGER AND I'LL BE VERY" 
190 PRINT«HAPPY TO OBLIGE, O.K., HERE IS THE FIRST HAND." 
200 LET X«INT(10*RNDC0)) 
210 DIM D(52),E(5),V(5),T(5),w(5) 
215 FOR AM TO 52 
LET D(A)«0 
NEXT A 
DIM 0(52) 

FOR As0 TO 39 STEP 13 
FOR C«l TO 13 
LET Q(A*C)«C 
NEXT C 
NExT A 
PRINT 

LET K»K+1 
FOR P"»i TO 5 
LET E(P)«0 
LET V(P)«0 
LET T(P)«0 
NEXT P 

LET V(3)*l 
PRINT 
PRINT 
PRINT 
PRINT»WAGER"» 

LET p»l 
INPUT W 
LET W(2)*W 

IF w<b0. then 1685 

IF W<«500 THEN 370 

IF *€>7777 THEN 360 

GOSUB 16*5 

G0TO315 

PRINT"THAT«S TOO MUCH - HOUSE LIMIT IS $50fl" 

GOTO 315 

PRINT 
375 PRINT "I SHOW", 
380 GOSUB 865 

if E(n«0 then 395 

LET V(4)«l 

LET V(5)el 
GOSUB 865 

LET Max 

LET P«2 
PRINT»FIRST CARD IS", 
GOSUB 865 

LET G-x 
PRlNT"NEXT CARD IS", 
GOSUB 865 
IF V(2)>0 THEN 605 

LET S««X 
IF VC3)<>1 THEN 605 
IF_T(P)<>21 THEN 505 

***BLACKJACK*** » 



220 
225 
230 

23 5 
240 
245 
250 
255 
260 
265 
270 
275 
280 
285 
290 
295 
300 
305 
310 
315 
320 
325 
330 
335 
340 
345 
350 
355 
360 
365 
370 



385 
390 
395 
400 
405 
410 
415 
420 
425 
430 
435 
440 
445 
450 
455 



(TYPE 1 OR 0, l MEANS YES)"; 



460 PRINT 

465 PRINT 

470 PRI'Nt" t h AT'S GETTING A BIt RIDICULOUS « » » S " 

475 PrINt 

480 prINt "MY H LE CArD WAs ", 

485 LET X«m 

490 GOSUB 1035 

LET W1«W1*1.5*W 

GOSUB 1335 

IF V(4)«0 THEN 570 

PRINT"INSURaNCE ANYONE 

INPUT I 

PRINT 

IF I«0 THEN 570 

IF T(i)<>2i THEN 555 
LET W1*W1+W 

PRINT 

545 PRINT "YOU WIN $"W;» ON YOUR INSURANCE BET" 
550 GOTO 570 

LET wl«wl-w/2 

PRINT 

PRlNT"YOU LOST $«W/2J" ON YOUR INSURANCE BET - I DON'T H AVE BLACKJACK" 

IF T(i)<>21 THEN 605 

PRINT 

PRINT«**I HAVE BLACKJACK**" 



495 
500 
505 
510 
515 
520 
525 
530 
535 
540 



555 
560 
565 
570 
575 
580 



585 PRINT "MY HOLE CARD WAS 

590 LET X»M 

595 GOSUB 1035 

600 GOTO 1300 

605 IF T(P)<"21 THE N 650 

610 IF E(P)>0 THEN 640 

615 PRINT"Y0U BUSTED, » ; 

620 PRINT"Y0UR TOTAL IS "T(P) 

625 LET Cl»T(P)-5*(INT(T(P)/5)) 

630 IF V(2)«l THEN 775 

635 GOTO 1175 



40 



640 

645 

650 

655 

660 

665 

670 

675 

680 

685 

690 

695 

700 

705 

710 

715 

720 

725 

730 

735 

740 

745 

750 

755 

760 

765 

770 

775 

780 

785 

790 

795 

800 

805 

810 

815 

820 

825 

830 

835 

840 

845 

850 

855 

860 

865 

870 

875 

880 

885 

890 

895 

900 

905 

910 

915 

920 

925 

930 

935 

940 

945 

950 

955 

960 

965 

970 

975 

960 

985 

990 

995 

1000 

1005 

1010 

1015 

1020 

1025 

1030 

1035 

1040 

1045 

1050 

1055 

1060 

1065 

1070 

1075 

1080 

1085 

1090 

1095 

1100 

1105 

1110 

1115 

1120 

1125 

1130 

1135 

1140 

1145 

1150 

1155 

1160 

1165 

1170 

1175 

1180 

1185 

1190 

1195 

1200 

1205 

1210 

1215 

1220 

1225 

1230 

1235 

12 4 



LET E(P)sE(P)-l 

LET T(P)«T(P)-i0 
IF VCD "2 THEN 620 

LET V(3)»V(3)+1 
PRINT»HIT "; 
INPUT VU) 
IF V(l)<>3 THEN 830 
IF V(2)>0 THEN 820 
IF VC3)<>2 THEN 820 
IF 0(G)«OCS) THEN 700 
PRINT"N0W IS THAT A PAIR?" 
GOTO 660 

LET VC2J.1 
IF Q(G)«»1 THEN 715 

LET VM)"2 

LET P-3 
PRINT" PLAY HAND ONE NOW" 
PRINT"FIRST CARD IS «, 

LET W(3)«W 

LET X«G 
G08UB 750 
GOTO 430 
GOSUB 990 
GOSUB 1035 

LET VC35-1 

LET T(P)«C 
RETURN 

LET P«2 

LET V(2)»2 
PRINT" PLAY HAND TWO NOW" 
PRINT"FIRST CARD IS", 

LET X«S 
GOSUB 750 
IF Q(G)»1 THEN 815 

LET V(1)*0 
GOTO 430 

PRINt«NO SPLITS NOW — T»Y AGAIN" 
GOTO 660 
IF V(l)<>2 THEN 855 

if vc3)«2 Then 850 

PRINT"T00 LAT £ TO DOUBLE* ChARLIE^ 
GOTO 660 

LET W(P)«2*W(P) 
IF V(1)>0 THEN 430 
GOTO 620 
GOSUB 900 

LET T(P)*T(P)+C 
IF V(5)«0 THEN 890 

LET V(5)*0 
RETURN 
GOSUB 1035 
RETURN 
IF R>s50 THEN 945 

LET N«10*(1+ABS(COS(N+W1))) 
FOR A«i TO N 

LET X*INT(52,999999*RND(Y)) 
IF X*0 THEN 915 
NEXT A 
IF D(X)*0 THEN 980 

LET RsR+1 
IF R<50 THEN 9 00 
FOR A*l TO 52 
IF D(A)«K THEN 960 

LET D(A)«0 
NEXT A 

LET R«0 
PRINT" I RESHUFFLED »; 
GOTO 900 

LET R»0 

LET D(X)«K 
IF GCX)<>1 THEN 1010 

LET C*ll 
LET E(P)s£(P)+l 

RETURN 

IF O(X)>10 THEN 1025 
LET C*Q(X) 

RETURN 
LET C«10 

RETURN 

GOSUB 1050 

GOSUB 1120 

RETURN 

IF Q(X)<>1 THEN J065 

PRINT" ACE »; 

RETURN 

IF Q(x)>10 t h EN 1080 

PRINT Q(X);" "J 

RETURN 

IF Q(X)>11 THEN 1095 

PRINT "JACK "{ 

RETURN 

IF Q(X)>12 THEN H10 

PRINT" QUEEN "J 

RETURN 

PRINT" KING »» 

RETURN 

IF X>39 THEN 1145 

IF X>26 ThEN 1155 

IF X>13 THEN 1165 

PRINT"0F SPADES" 

RETURN 

PRINT"OF CLUBS" 

RETURN 

PRINT"OF HEARTS" 

RETURN 

PRlNT"0 F DIAMONDS" 

RETURN 
LET P*2 
PRINT "MY HOLE CARD WAS ", 
LET X«M 

GOSUB 1035 

IF T(2)'<22 THEN 1 2 1» 

IF V(2)*fl THEN i3 

I p T(3)>21 THEN 1300 
LET PM 

IF T(1)<17 THEN 1360 

IF T(1)>17 THE N 1230 

IF E(l)>f? THEN 1360 

IF T(l)>21 THEN 1375 
LET Ps2 

PRINT"MY TOTAL IS H T(1) 



BLKJAC 

1245 IF TCP)>21 THEN 1300 

1250 IF TC i 3>2i THEN 1265 

1265 IF T(i)>T(P) THEN 1300 

1260 IF TC1)"T(P) TMEN 1330 

1265 LET wt»wl+W(p) 

1270 IP Cl>3 THEN 1445 

1275 IF Cl>2 THEN 1465 

1280 IF C 1 >1 THEN 1485 

1285 IF Cl>0 THEN 1505 

1290 GOTO 1525 

1295 GOTO 1330 

1300 LET Wi»M-WCP) 

1305 IF Cl>3 THEN 1545 

1310 IF Cl>2 THEN J565 

1315 IF C1>1 THEN 1585 

1320 IF C1>0 THEN 1605 

1325 GOTO 1625 

1330 IF VC2)>0 THEN 1345 

1335 GOSUB 1405 

1340 GOTO 265 

1345 LET P«3 

1350 LET VC2)«0 

1355 GOTO 1245 

1360 PRINT "I DRAui", 

1365 GOSUB 865 

1370 GOTO 1210 

1375 IF E(l)s0 THEN 1395 

1380 LET EC1)*EC1)-1 

1385 LET T(1)«TC1)-10 

1390 GOTO 1210 

1395 PRINT"I BUSTED*****" 

1400 GOTO 1235 

1405 IF wl<0 THEN 1425 

1410 IF wl»0 T*En 1435 

1415 PRiMT»YOU«RE AhEAD $"W1 

1420 RETURN 

U25 PRINT USING "YOU'RE BEHIND $**##,.#*% -Wl 

1430 RETURN 

1435 PRINT»YOU'RE EVEN" 

1440 RETURN 

1445 PRINT 

1450 PRIN T "I MUST HAVE DEALT WRONG," 

1455 PRINT 

1460 GOTO 1330 

1465 PRINT 

1470 PRINT»YOU LUCKED OUT AGAlNj" 

1475 PRINT 

1480 GOTO 1330 

1485 PRINT 

1490 PpINT»YOu MUST HAyE BEEN PEEKING." 

1495 PRINT 

1500 goto 1330 

1505 PRINT 

1510 PRINT"I COULD LOSE MY JOB THIS WAY," 

1515 PRINT 

1520 GOTO 1330 

1525 PRINT 

1530 PRinT»ThE CARDS HAVE TURNED AGAjmST mE:» 

1535 PRINT 

1540 GOTO 1330 

1545 . PRINT 

1550 PRINT"THE BOTTOM OF THE DECK STRIKES AGAIN}" 

1555 PRINT 

1560 GOTO 1330 

1565 PRINT 

1570 PRINT"A VICTORY FOR US GOOD GUYS," 

1575 PRINT 

1580 GOTO 1330 

1585 PRINT 

1590 PRINT"YOU CAN'T BEAT SKILL," 

1595 PRINT 

1600 GOTO 1330 

1605 PRINT 

1610 PRlNT"YOU CANiT win »Em'AlL»" 

1615 PRINT 

1620 GOTO 1330 

1625 PRINT 

1630 PRINT"BABY GETS A NEW PAIR OF SHOESl" 

1635 PRINT 

1640 GOTO 1330 

1645 FOR M9 « 1 TO 52 

1650 lET D(m9)«0 

1655 next m9 

1660 LET R«0 

1665 PRINT 

1670 PRINT" I RESHUFFLED" 

1675 PRINT"" 

1680 RETURN 

1685 END 



SAMPLE RUN 

TVPE 'YES' IF YOU NEED HELP? YES 



THIS IS A GAME OF BLACKJACK, LAS VEGAS STYLE. 
HERE ARE THE RULES OF THE HOUSE. THE DEALER 
MUST HIT ON 16 OR LESS AND WILL STAY ON 17 OR 
MORE. YOU MAY SPLIT TWO CARDS IF THEY ARE THE 
SAME AND PLAY ONE HAND WITH EACH OF THEM. ALSO, 
YOU MAY DOUBLE YOUR BET AND RECEIVE EXACTLY ONE 
MORE CARD ANY TIME ON YOUR FIRST HIT. THE TYPING 
INSTRUCTIONS ARE: 8-NO HIT.; 1-HIT; 2-DOUBLE; AND 
3- SPLIT A PAIR. 

ANY TIME YOU WANT ME TO RESHUFFLE THE CARDS SIMPLY 
TYPE 7777 WHEN I ASK FOR YOUR WAGER AND I'LL BE VERY 
HAPPY TO OBLIGE. 0. K. , HERE IS THE FIRST HAND. 



I SHOW 

FIRST CARD IS 

NEXT CARD IS 



ACE OF SPADES 
7 OF SPADES 
10 OF HEARTS 



INSURANCE ANYONE <TVPE 1 OR 



1 MEANS YES)? 8 



HIT ? 

YOUR TOTAL IS 17 

MY HOLE CARD MAS HOE OF CLUBS 

I DRAW 5 OF SPADES 

I DRAW 8 OF CLUBS 

I DRAW 8 OF HEARTS 

I BUSTED***** 

MY TOTAL IS 23 

YOU MUST HAVE BEEN PEEKING. 

YOU'RE AHEHD * 10 



WAGER? 19 



QUEEN OF CLUBS 
7 OF DIAMONDS 
I2UEEN OF HEARTS 



I SHOW 

FIRST CARD IS 

NEXT CARD IS 

HIT ? 8 

YOUR TOTAL IS 17 

MY HOLE CARD WAS 

I DRAW 10 OF CLUBS 

I BUSTED***** 

MY TOTAL IS 26 

YOU MUST HAVE BEEN PEEKING. 

YOU'RE AHEAD S 28 



OF DIAMONDS 



WAGER? 



8 OF SPADES 
5 OF CLUBS 

9 OF HEARTS 



3 OF CLUBS 



I SHOW 

FIRST CARD IS 

NEXT CARD IS 

HIT ? a 

NEXT CARD IS 

HIT ? 8 

YOUR TOTAL IS 17 

MY HOLE CARD WAS 

I DRAW 3 OF HEARTS 

I DRAW KING OF CLUBS 

I BUSTED***** 

MY TOTAL IS 25 

YOU MUST HAVE BEEN PEEKING. 

YOU' RE AHEAD $ 30 



WAGER? 18 

;i SHOW KING OF SPADES 

FIRST CARD IS 6 OF CLUBS 

NEXT CARD IS ACE OF HEARTS 

HIT ? 1 

NEXT CARD IS JACK OF SPADES 

HIT ? 8 

YOUR TOTAL IS 17 

MY HOLE CARD WAS 2 

I DRAW 4 OF HEARTS 

I DRAW 2 OF DIAMONDS 

MY TOTAL IS 18 



OF DIAMONDS 



OF SPADES 



YOU CAN'T BEAT SKILL. 
YOU'RE AHEAD $ 28 



6 OF HEARTS 
3 OF SPADES 
5 OF HEARTS 

JACK OF HEARTS 



41 



WAGER? 10 

I SHOW 

FIRST CARD IS 

NEXT CARD IS 

HIT ? 1 

NEXT CARD IS 

HIT ? O 

YOUR TOTAL IS 18 

MY HOLE CARD WAS 5 

I DRAW 18 OF DIAMONDS 

MV TOTAL IS 21 

fl VICTORY FOR US GOOD GUYS. 

YOU'RE AHEAD * 18 



BLKJAK 



PROGRAM LISTING 



SAMPLE RUN 



5 PRINT "WELCOME TO DIGITAL EDUSVSTEM COMPUTER BLACKJACK!!" 

6 PRINTSPRINT "YOUR DEALER TONIGHT IS PETEV P. EIGHT. " 

7 PRINT "WATCH HIM CLOSELY. ... HE HAS A REPUTATION FOR" 

8 PRINT "DEALING OFF THE BOTTOM OF THE DECK. "\PRINT 

9 RANDOMIZE 
19 DIM A<13> 

26 PRINT "QUESTIONS REQUIRING A VES OR NO ANSWER" 

25 PRINT "SHOULD BE ANSWERED WITH A ' V FOR YES, ' N' FOR NO. "SPRINT 

30 PRINT "DON'T START PLAYING WITH LESS THAN *180. . HAVE FUN! "SPRINT 

48 PRINT "HOW MANY DOLLARS ARE YOU STARTING WITH"; 

■41 INPUT F 

42 PRINT 

43 F1 = F 

50 PRINT "WHAT IS YOUR WAGER THIS TIME".; 

51 INPUT W 

52 PRINT 

53 IF W>F GOTO 56 

54 IF W<16 GOTO 58 

55 GOTO 109 

56 PRINT "YOUR BET EXCEEDS YOUR REMAINING DOLLARS. " 

57 GOTO 50 

58 PRINT "MINIMUM WAGER IS *10. " 

59 GOTO 50 
190 GOSUB 780 
102 P1=I 

104 PRINT "YOUR FIRST CARD IS "CHR*<L> 

106 GOSUB 788 

110 P2=I 

112 PRINT "YOUR SECOND CARD IS "CHR*<L) 

115 GOTO 20O 

117 PRINT "YOU HAVE "P3" SHOWING. " 

119 GOSUB 760 

120 P3=P3+I 

122 PRINT "YOU GOT A "CHR*<L> 

123 IF P3>21 GOTO 820 

124 GOTO 117 

200 GOSUB 780 

201 P3=P1+P2 

202 D1 = I 

204 GOSUB 780 

206 D2=I 

208 PRINT "DEALER SHOWS A "CHR*<L> 

210 GOTO 117 

212 D3=D1+D2 

214 PRINT "DEALER HAS "D3 

216 IF D3>16 GOTO 222 

217 GOSUB 780 

238 PRINT "DEALER GETS A "CHR*<L> 

219 D3-D3+I 

220 GOTO 214 

222 IF D3<22 GOTO 80© 

224 PRINT "DEALER BUSTED. " 

226 GOTO 802 

760 PRINT "DO YOU WANT A HIT?".; 

762 INPUT $K 

764 PRINT 

766 IF K = #N GOTO 212 

768 GOSUB 780 

770 RETURN 

780 I=INT(13*RND<0)+1) 

782 fl<I)=fl<I>+l 

784 IF fl<I)>4 GOTO 780 

786 GOSUB 900 

788 RETURN 

800 IF D3>=P3 GOTO 820 

802 F=F+W 

806 PRINT "YOU WIN. YOU NOW HAVE *"F 

808 GOTO 980 

820 F = F-W 

822 PRINT "YOU LOSE. YOU NOW HAVE *"F 

824 GOTO 980 

900 IF IOl GOTO 910 

904 1=11 
906 L = #A 

905 GOTO 942 

910 IF 1013 GOTO 920 

312 1=16 

3.14 L = #K 

316 GOTO 942 

320 IF 1012 GOTO 330 

922 1=10 

324 L=#G 

326- GOTO 942 

930 IF I Oil GOTO 937 

332 1=10 
334 L = #,T 

336 GOTO 942 

337 IF IO10 GOTO 940 

338 L=#T 

333 GOTO 942 
340 L=I+48 
342 RETURN 

380 PRINT "DO YOU WISH TO PLAY AGAIN?".; 

382 INPUT *K.. 

384 PRINTSPRINT 

SB6 IF K=#V GOTO 50 

987 PRINTSPRINTSPRINT SIF F>F1 THEN 995 

388 PRINT "TOO BAD! YOU LOST " Fl-F "DOLLARS AT THE EDUSVSTEM CASINO. " 

390 GOTO 998 

395 PRINT "NOT BRD ! YOU WON"F-Fl"DOLLRRS AT THE EDUSVSTEM CASINO. " 

998 PRINTSPRINT "HOPE YOU ENJOYED YOURSELF. THANKS FOR PLAYING. " 

939 END 

READY 



BLJACK EDUSVSTEM 30 

WELCOME TO DIGITAL EDUSVSTEM COMPUTER BLACKJACK!! 

YOUR DEALER TONIGHT IS PETEV P. EIGHT. 

WATCH HIM CLOSELY. . . . HE HAS A REPUTATION FOR 

DEALING OFF THE BOTTOM OF THE DECK. 

QUESTIONS REQUIRING A VES OR NO ANSWER 

SHOULD BE ANSWERED WITH A 'V FOR VES, ' N"' FOR NO. 

DON'T START PLAVING WITH LESS THAN *1O0. . HAVE FUN! 

HOW MANY DOLLARS ARE YOU STARTING WITH7200 

WHAT IS YOUR WAGER THIS TIME?2@ 

YOUR FIRST CARD IS T 

YOUR SECOND CARD IS A 

DEALER SHOWS A 3 

YOU HAVE 21 SHOWING. 

DO YOU WANT A HIT?N 

DEALER HAS 11 

DEALER GETS A 2 

DEALER HAS 13 

DEALER GETS A T 

DEALER HAS 23 

DEALER BUSTED. 

YOU WIN. VOU NOW HAVE * 220 

DO YOU WISH TO PLAY AGAIN?V 

WHAT IS YOUR WAGER THIS TTME?50 

YOUR FIRST CARD IS K 

YOUR SECOND CARD IS 7 

DEALER SHOWS A 6 

YOU HAVE 17 SHOWING. 

DO YOU WANT A HIT7N 

DEALER HAS 17 

YOU LOSE. VOU NOW HAVE $ 170 

DO YOU WISH TO PLAY AGAIN?Y 

WHAT IS YOUR WAGER THIS TIME750 

YOUR FIRST CARD IS 5 

YOUR SECOND CARD IS 2 

DEALER SHOWS AS 

YOU HAVE 7 SHOWING. 

DO YOU WANT A HIT?V 

YOU GOT A 7 

YOU HAVE 14 SHOWING. 

DO YOU WANT A HIT?Y 

VOU GOT A G 

YOU LOSE. YOU' NOW HAVE $ 120 

DO YOU WISH TO PLAY AGAIN?V 

WHAT IS YOUR WAGER THIS TIME?!©© 

YOUR FIRST CARD IS 9 

YOUR SECOND CARD IS 4 

DEALER SHOWS A 6 

YOU HAVE 13 SHOWING. 

DO YOU WANT A HIT?V 

YOU GOT A 2 

YOU HAVE 15 SHOWING. 

DO YOU WANT A HIT?V 

YOU GOT A 3 

YOU HAVE 18 SHOWING. 

DO YOU WANT A HIT?N 

DEALER HAS 16 

DEALER GETS A 2 

DEALER HAS 18 

YOU LOSE. YOU NOW HAVE * 20 

DO YOU WISH TO PLAY AGAIN7V 

WHAT IS YOUR WAGER THIS TIME?10 

YOUR FIRST CARD IS 5 

YOUR SECOND CARD IS G 

DEALER SHOWS A 4 

YOU HAVE 15 SHOWING. 

DO YOU WANT A HIT?V 

YOU GOT A 7 

YOU LOSE. VOU NOW HAVE * 10 

DO YOU WISH TO PLAY AGAIN?N 



TOO BAD! YOU LOST 190 DOLLARS, AT THE EDUSVSTEM CASINO. 
HOPE YOU ENJOYED YOURSELF. ' THANKS FOR PLAVING. 
READY 



42 



BOAT 



SUBMARINE VS GUNBOAT 



Description 



You are captain of a submarine and the computer is captain of 
a gunboat. The speed of the gunboat is given at the beginning 
of the game. You fire torpedos at the gunboat. To sink it, 
you must hit it twice in at least two vulnerable places, or 
once in a vulnerable place and twice in any other part of the 
hull. But, if you ever miss, the gunboat will open fire on 
you. If this happens, you alternatively fire at each other 
until you sink the gunboat or until he sinks you. 

Source 

To the best of our knowledge, we think BOAT was originally 
written by a student at the University of Georgia, Athens, GA. 




43 



PROGRAM LISTING 



SAMPLE RUN 



5 PRINT "THIS IS THF OAMF OF WAR BETWEEN A SUBMARINE AND A" 

10 PRINT "NAVAL ^"N BOAT. WOULD YOU LIKF INSTRUCTIONS"; 

11 INPUT X* 

1?. I* X«="NO" TH r N 100 

13 PRINT "YOU ARE THE CAPTAIN OF THF SUBMARINE AND THE" 

14 PRINT "COMPUTER IS THE CAPTAIN OP THF GUN BOAT." 

20 PRINT "THF SPE r O O* 1 TUF 0!!N POAT WILL BE GIVEN. AT THE BEGINNING OF" 

25 PRINT "THE OAMF AND YOU HAVE TO HIT THE GUN BOAT TWICE" 

50 PRINT "IN AT L^AST TWO VULNERABLE PLACES, OR ONCE IN A" 

35 PRINT "VULNERABLE PLAC r AND TWICE IN ANY OTHER PART OF THE" 

40 PRINT "VI?LL OF THF GUN POAT. PUT IF YOU MISS ANY ONE TIME THE" 

45 PRINT "RUN POAT WILL OP r N firf ON YOU UNTIL IT SINKS YOU OR YOU" 

5fl PPINT "SINK THE GUN POAT! YOU WILL BF ALLOWED TO TAKE TURNS FIRE-" 

ss PRINT "ING AT THE ohm P.QAT ROOD LUCK , MEIN FURHER !!!!!!!!! " 

100 A=0 

110 Rr0 

120 RANDOMIZE 

130 FOR 1=1 TO 5 

140 LET R:100*RND(0) 

170 IF R>-10 THEN 190 

180 NFXT I 

100 IF R< = 40 THEN 210 

2P0 GOTC 130 

210 PRINT "THF SPE^P OE THE GUN BOAT IS NOW ";R;" KNOTS" 

220 RANDOMlZF 

230 EOR F=I TO s 

240 LFT S=10000*BND(0) 

270 IF S>rl000 THFN 290 

280 NEXT E 

290 IE S<=10000 THEN "M0 

300 GO TO 230 

310 PRINT "THE oa.NG r r pOM thF GUN POAT TO THE SUBMARINE IS" 

320 PRINT "NOW ":S;" YARDS." 

330 LET 7=ATN(50/R) 

340 LET D3r7*(lS0/3. 14l=;9) 

34" P^INT "Tl-F APPROXIMATE ANGLE YOU SHOULD EIRE YOUR TORPEDO IS" 

34* pplNT "Between " • INT CD 3-2) ; " AND " ; INT CD 3+2) ;" DEGREES." 

3*r* INPUT D 

35 1 LET T = n*3. t4! c< 5/!R0 

360 LFT R8=S/C0S(7 ) 

370 LET Y3rP8*SIN(7) 

380 LFT Y9rR8*SIN(T) 

390 L r T . Y2rY3-20 

400 L r T YB=Y^-40 

^10 L r T Y4=Y3+20 

420 LET Y5=Y3+4 

430 IT Y9>=Y0 THEM 710 

A 32 GOTO 5 20 

435 IF Y9<Y2 THEN 810 

45 GOTO 470 

453 IF Y9<Y2 THFN 810 

4*0 GOTO *50 

470 IF Y9>rY3 THFN 490 

480 GOTO 890 

490 IE V9<Y4 THFN 930 

520 PRINT "YOU MISSED!" 

"5 30 PAMD0MI7F 

540 L r T YOrRNDCP) 

55 LFT Wrl0000*Y9 

5*0 PPINT "TH r SHOT Eioffi trpQ^ T wr rsnN ^OAT T q THF SUBMARINE" 

570 PRINT -WAS WITHIN "; ABS(W-S)*2/1 000;" YARDS ." 

580 IE ABSCW-S)>r2^00 GOTO 120 

590 PRINT "YOU ARF SUNv mc-j^ FPIEND !" 

5 95 GOTO 1900 

610 PRINT 

612 PRINT 

513 PPINT "********* Y0!T MAPF A VUL7N7FRABLF STRIKE! *************" 

*2f A = A+1 

*30 IE A>=2 GOTO' 700 

*40 GOTO 120 

55 PRINT 

65! PRINT 

652 PPINT "********* vOU DAMAGED THF GUN BOAT! *************" 

5*0 BrB+1 

670 IE B>=3 GOTO 700 

^?^ IF A+B>r3 TH C N 700 

*90 GO TO 120 

700 PRINT "I AM S"NK! GOOD BYE CRUEL WORLD .... (GLUB . .GLU3 .. )" 

705 nOTO 1800 

710 POINT " ********* **+ !" 

720 PRINT " ********* ***+*+* I" 

730 PPINT " - HHH !" 

740 PRINT " UUU ! +++++]" 

750 PRINT " \\\\===0r0r0" 

750 P^INT " L I" 

770 POINT " --/PR IIIIIIIIII /DD\--" 

7P0 PRINT " [:::::::::::::::::::::.::]- 

790 PRINT " /npnp /HHHHH HHHH\ /PDDDX-S 

P00 GO TO 435 

*10 PRINT " rrrptrrrrrrFN /EEEEEEEEEEEEEEE 

R20PRINT" EFrrrrrcprFFrrFFFEFFEFEFEFFEEEEEEEEE EEEEEEEE 

«30PRlNT" * F'-^crrr-cccTpF-FFFEFEFEFFFFEEEEEEEEEEEEEEEEEEEEEE/ 

?i\* no TO 510 

ff50PRlNT"\FEEFrnTrrptrrFFrrrFPTrF='\ ,/EEEEEEEEEEEEEEEEE 

<?*0POINT" rrFrrprrprr FFFEFFFFEFFFEEEEEEFEEEEEEE EEEEEE7 

BTFPRlNT" \rrrrjrrp * EEFEFEFFEFEEEEEEEEFEEEEEEEEEEEEEEE/" 

R80 GO TO 65 

S90PR I NT"\EFrcrrrrFrrrrrrrFrrrrrFrr /EEEEEEEEEEEEEEEE? 

900PRINT" FrFrrFrrtrrrrrcrc-ppr EEEEE EEEEE 

910PRINT" \rrrrrrrrrrrrrrr EEEEEEEEFEEEEEEE/" 

920 *0 TO 610 

Q3^PRlNT"\EFFEFFFirFFCTrrt-r r rr N ; /EEEEEEEEEEEEFEEEEE 

Q5 0PRINT" EFrc-cFrcrFTrFrprrirFFrFc-FFEFFFFEFFFEEFEEEEEEEEEEEEE" 

960PRINT" \FErcc-c-FFnTrFrrFFFFFFFFFFFFFFFEEFEFEEEEEEEEEEE *" 

970 GO TO 650 ----.-. 

1800 PRINT " /I" 

1801 PRINT " //HH1" 

1802 PRINT " X> T/HHHH1" 

1803 PRINT •*'■ *******************************" 

1804 PRINT 

1900 PRINT "WOULD vQ!J LIK r TO TRY AGAIN"; 

1901 INPUT ?* 

1<>02 IE 7«r"vps" TVC-N S 
2000 END 



THIS IS THE GAME OF WAR BETWEFN A SUBMARINE AND A 

NAVAL GUN BOAT. WOULD vQ!J LIKF INSTRUCTIONS? YES 

vOU ARE THE CAPTAIN OF THE SUBMARINE AND THE 

COMPUTER IS THE CAPTAIN OF THE GUN BOAT. 

THE SPFFD OF THF GUN POAT WILL BF GIVEN AT THE BEGINNING OF 

THE GAME AND YOU HAVE TO HIT THE GUN BOAT .TWICE 

IN AT LEAST TWO VULNERABLE PLACES, OR ONCE IN A 

VULNERABLE PLACE AND TWICF IN ANY OTHER PART OF THE 

HULL OF THE GUN BOAT. PUT IF YOU MISS ANY ONE TIME THE 

GUN BOAT WILL OPFN EIRE ON vOM UNTIL IT SINKS YOU OR YOU 

SINK THF GUN BOAT! YOU WILL BF ALLOWED TO TAKE TURNS FIRE- 

TNG AT THE GUN BOAT ......GOOD LUCK , MEIN FURHER!!!!!!!!! 

T'-fE SPEED 0^ THE GUN BOAT IS NOW 17.09028 KNOTS 

THE RANGF FROM THF GUN BOAT TO THF SUBMARINE IS 

NOW 5 136.849 YARDS. 

THE APPROXIMATE ANGLE YOU SHOULD fire YOUR TORPEDO IS 

BETWEEN 69 AND 73 DEGREES. 

? 71 

********* ***+*+* ! 
HHH ! 

UUU ! +++++] 
WW™ 0=0:0 

L I 

— /DP IIIIIIIIII /DD\ — 

/ppnp /H"HHH HHHH\ /PDDD\ 

\rpFFFFFFFFrvFFFFFrrrT7Frp /EEEEEEEEEEEEEEEEE/ 

EEcc-FFFFEFFFrrrrrr EEEEE EEEEEE/ 

\FSTFFFEFFfCTCFr EEFFEEEEEEEEEEEE/ 



********* YOU MARE A VUL?N?eraBLE STRIKE! ************* 

Tvf SREFP oe TH r GUN POAT IS NOW 17.18836 KNOTS 

TpF RANGE ER0M THE ?v.<N BOAT TO THE SUBMARINE IS 

MOW 3427.992 YARDS. 

TH r APPROXIMATE A.MGLE YO" SHOULD c ipF YOUR TORPEDO IS 

BETWEEN 69 AND 73 DEGREES. 

? 70 • 

YOU MlSSFD! 

THF SHOT eirfp FROM TH r GUN ^OAT 

WAS WITHIN 6.328317" YARDS 

THE speed OE THE GUN BOAT IS NOW 

TH r RANGF c ROM TH r GUN BOAT TO THF SUBMARINE IS 

MOW 1787.37 YARDS. 

TR r APPROXIMATE ANGLE YOU SHOULD FIRE YOUR TORPEDO IS 



TO THE SUBMARINE 
" 32. 91 102 KNOTS 



BETWEEN 
? 56 



54 AND 58 DEGREES. 

********* **+ f 

********* ***+*+* f 

HHH ! 

UUU ! -H-+++] 
W\\ = "0=0:0 

L- I 

--/OP IIIIIIIIII /DD\ — 

/DDDR /HHHHH HHHH\ /PDDD\ 

FFFPFFtrFFtrr\ /EFEEEEEEEEEEEEEEEEEE/ 

rrFFFrrrrrrrrTrcprFFFFrFrtrtrFFEFEEEEE EEEEEEEEE/ 
EFrFErFrrPFFrrrrFrFEFEEEEEEFEEEEEFEEEEEEEEEEEEE/ 



********* YOU MAD r A VUL?N?eoaBLE STRIKE! ************* 

I AM S"NK!. .GOOD Pvr CRUFL WORLD .... (GLUB . .GLUB . .) 

/! 
//HH1 
y» t/u H uhi 
******************************* 



WOULD YOU LIKE T n tpy AGAIN? NO 



ota^v 



44 



BOMBER 



FLY A WORLD WAR II BOMBER 



Description 



In this program, you fly a World War II bomber for one of the 
four protagonists of the war. You then pick your target or the 
type of plane you are flying. Depending upon your flying ex- 
perience and the quality of the enemy defenders , you then may 
accomplish your mission, get shot down, or make it back through 
enemy fire. In any case, you get a chance to fly again. 

Program Author 

This program was somewhat modified at DIGITAL. The original 
author is : 

David Sherman 

Curtis Junior High School 

Sudbury, MA 01776 




45 



PROGRAM LISTING 



SAMPLE RUN 



5 RANDOMlPRINT n YOU ARE NOW A PILOT IN A WORLD WAR II 60M8ER 

10 INPUT "WHAT SIDE — ITALY(I), ALLIE3C2). JAPANESE(3), GERMANY (4) "J A 

20 IF A>0 AND A<5 THEN 25 ELSE PRINT "TRY AGAIN ,.,. »\GOTO 10 

25 ON A GOTO 30,110,200,220 

30 INPUT "WHAT "IS YOUR TARGET — ALBANIAM), GREECE(2), NORTH AFRICA-C3) " IB 

40 IF B>0 AND B<4 THEN 4b ELSE PRINT "TRY AGAIN , , , , "\GOTO 30 

45 PRINT\ONB GOTO 50,80,90 

50 PRINT"SHOULD BE EASY. YOU'RE FLYING A NAZI*MADE PLANE, 

60 GOTO 280 

80 PRINT "BE CAREFULii l"\GOTO 280 

90 PRINT "YOU'RE GOING FOR THE OIL, EH?«\GOTO 280 

110 INPUT "AIRCRAFT — L I BER ATOR ( 1 ) , B-29C?)# B-17f3)» LANCASTER (4) » I G 

120 IF G>0 AND G<5 THEN 125 ELSE PRINT "TRY AGA IN . , , , "\GOTO 110 

125 PRINTVON G GOTO 130,150,170,190 

130 PRINT "YOU'VE GOT 2 TONS OF BOMBS FLYING FOR PLOESTI" 

140 GOTO 280 

150 PRINT "YOU'RE DROPPING THE A-BOMB ON HIROSHIMA," 

160 GOTO 28t5 

170 PRINT "YOU'RE CHASING THE BISMARK IN THE NORTH SEA," 

180 GOTO 280 

190 PRINT "YOU'RE BUSTING A GERMAN HEAVY WATER PLANT IN THE RUHR," 

195 GOTO 280 

200 PRINT "YOU'RE FLYING A KAMIKAZE (SUICIDE BOMBER) OVER THE USS LEXINGTON," 

205 INPUT "YOUR FIRST KAMIKAZE MISSION (Y OR N)"»F$ 

208 IF F$b«N" THEN S»0\GOTO 358 

210 PRINTMF RND>,6b THEN 325 ELSE 380 

220 PRINT "A NAZI, EH? Oh ;0ELL. ARE YOU GOING FOR RUSSIA(l), ENGLANDC2)' 1 

230 INPUT"0R FRANCE(3)»JM\I-- M>0 AND M<4 THEM 235 ELSE PRINT " WHAT??"\GOTO 220 

235 PRfNT\ON M GOTO 250,260,270 

250 PRINT "YOU'RE HEARING STALINGRAD "\GOTO 28fl 

260 PRINT "NEARING LONDON, dE CAREFUL, THEY'VE GOT A GH0D AIR-RAID DEFENCE," 

265 GOTO 280 

270 PRINT "NEARING VERSAILLES. DUCK SOUP, THEY'RE NEARLY DEFENSELESS." 

280 PRINT 

285 INPUT "HOW MANY M'lsglO'Ns HAVE YOU FLO*N"jD 

290 IF O<160 THEN 300 ELSE »RINT "MISSIONS, NOT MILES.,,," 

295 PRINT "150 MISSIONS IS HIGH EVEN FOR OLD-TIMERS, NO*' THEN,"\GOTO 285 

300 PRINTMF D<1<*0 THEN 310 ELSE PRINT "THAT'S PUSHING THE QDDSl"\GQTO 320 

310 IF D<25 THEN PRINT "FRESH OUT OF TRAINING, EH?»' 

320 PRINTMF D<168*RND THEN 330 

325 PRINT "DIRECT HlTniT "TNT C100*RND) "KILLED I MISSION SUCCESSFUL . "SGOTO 390 

330 PRINT "MISSED TARGET 6Y » INT (2+30*RNQ) "MILES U " 

335 PRINT "NOW YOU'RE REALLY IN FOR IT il"\PRINT 

340 INPUT "DOES THE E^EMY HAVE GUNS(l), MISSILES(P), OR HOTh(i)">R 

345 IF R>0 AND R<4 THEN 350 ELSE PRINT "TRY AGA IM , . . , "\GOTO 340 

350 PRINTMF R»2 THEN 36*3 

355 INPUT "WHAT IS THE PERCENT HIT RATE OF THE ENf*Y GUNNERS (10 TO 5B)"IS 

358 IF 8<10 THEN PRINT "YOU LIE, BUT YOU'LL PAY , . , , "\PRINT\tiOTO 380 

360 PRINTMF R>1 THEN Ts35 

365 IF S+T>100*RND THEN 38« 

i77i PRINT"YOU MADE IT THROUGH TREMENOQUS FLAKM m *GOTO 390 

380 PRINT "***** BOOM *****" 

384 PRINT "YOU HAVE BEEN SHOT OOwN " 

386 PRINT "DEARLY BELOVED, *E ARE GATHERED HERE TODAY TO PAY OUR LAST TRIBUTE,, 
390 PRINT\PRINT\PRINT\INPUT "RLAY AGAIN (Y OR N)"»U$\'lF U$s"Y" THEN t PI 
400 PRINT "CHICKEMJ il i 1"\PRINT\PRIMT 
999 END 



VOU PRE NOW A PILOT IN ft WORLD WAR II BOMBER 

WHAT SIDE — ITALYd), FILLIES<2), JAPANESECO, GERMANV<4)? 2 

AIRCRAFT -- LIBERRTOR(l), B-29<2), B-17<2), LANCASTER<4 )? 8 

TRV flGRIN. ... 

AIRCRAFT ■— LIBERATOR(i), B-29<2), B-17CO, LANCASTER (4 ) ? 1 

VOU'VE GOT 2 TONS OF BOMBS FLVIN6 FOR PLOESTI 

HO M H fl N V MISSIONS H fl V E V U F L W-N ? 1 

FRESH OUT OF TRAINING, EH? 

MISSED TARGET BV 30 MILES! I 
NOW VOU' RE REALLY IN FOR IT !! 

DOES THE ENEMV.HAVE GUNS<1>, MISSILES (2), OR BOTH CO? 1 

•WHAT IS THE PERCENT HIT RATE OF THE ENEMY GUNNERS (IS TO 50)? 15 

VOU MADE IT THROUGH TREMENDOUS FLAK! ! 



PLAY AGAIN (V OR N>? V 

WHAT SIDE — ITALYd).. ALLIES<2), JAPANESE (2) .. GERMANVC4)? 2 

AIRCRAFT -- LIBERATOR(l), B~29<2), B~17<2), LANCASTER ( 4 ) ? 3 

YOU'RE CHASING THE BISMARK IN THE NORTH SEA. 

HOW MANY MISSIONS HAVE VOU FLOWN? 200 

MISSIONS, NOT MILES. ... 

15Q MISSIONS IS HIGH EVEN FOR OLD-TIMERS. NOW THEN, 

HOW MANY MISSIONS HAVE VOU FLOWN? 50 



MISSED TARGET BV 28 MILES! I 
NOW VOU' RE REALLY IN FOR IT 



DOES THE ENEMY HAVE GUNS<1>, M ISS I LES<2 ) , OR BOTH (3 



YOU MADE IT THROUGH TREMENDOUS FLAK! 



PLAV AGAIN <V OR N>? V 

WHAT SIDE -- ITALY-: 1), ALLIESC2), JAPANESE < 2) , GERMANY ( 4 ) ? 4 
fl NAZI, EH? OH WELL. ARE VOU GOING FOR RUSSIA(i), ENGLAND (2) 
OR FRANCE<3)? 2 

NEARING LONDON. BE CAREFUL, THEY'VE GOT A GOOD AIR-RAID DEFENCE. 

HOW MANY MISSIONS HAVE VOU FLOWN? 10 

FRESH OUT OF TRAINING, EH? 

HISSED TARGET BV 2 MILES!! 
NOW YOU'RE REALLY IN FOR IT !! 



DOES THE ENEMY HAVE GUNS<1), M I SS I LES < 2 ) , OR BOTH (2)? 3 

WHAT IS THE PERCENT HIT RATE OF THE ENEMY GUNNERS CIS TO 50)? 4@ 

* * * + * BOOM + + * * * 

VOU HAVE BEEN SHOT DOWN 

DEARLY BELOVED, WE ARE GATHERED HERE TODAY TO PAY OUR LAST TRIBUTE. 



PLAY AGAIN <Y OR N)? V 

WHAT SIDE -- ITALY •;!), ALLIES (2), JAPANESE < 2 ) , GERMflNV(4)? 1 

WHAT IS VOUR TARGET — ALBANIA(l), GREECE(2), NORTH AFR I CA ( 3 ) ? 3 

VOU' RE GOING FOR THE OIL, EH? 

HOW MANY MISSIONS HAVE VOU FLOWN? 120 

THAT'S PUSHING THE ODDS! 

HISSED TARGET BV 13 MILES!! 
NOW YOU'RE REALLY IN FOR IT M 

DOES THE ENEMY HAVE GUNS(l), M I SS I LES < 2 ) , OR B0THC3)? 1 

WHAT IS THE PERCENT HIT RATE OF THE ENEMY GUNNERS (IS TO 50)? 30 

VOU MADE IT T H R U G H T RE M E N D U S FLAK!! 



PLAY AGAIN <V OR N)? N 
CHICKEN! MM 



46 



BOUNCE 



PLOT OF BOUNCING BALL 



Description 

This program plots a bouncing ball. Most computer plots run 
along the paper in the terminal (top to bottom) ; however , this 
plot is drawn horizontally on the paper (left to right) . 

You may specify the initial velocity of the ball and the 
coefficient of elasticity of the ball (a superball is about 
0.85 — other balls are much less). You also specify the 
time increment to be used in "strobing" the flight of the 
ball. In other words, it is as though the ball is thrown 
up in a darkened room and you flash a light at fixed time 
intervals and photograph the progress of the ball. 

Program Author 

Val Skalabrin 

Newport-Mesa Unified School District 

Newport Beach, GA 92660 



BOUNCE EDUSYSTEM 30 

90 DIM T<20> 

108 PRINT "THIS SIMULATION LETS YOU SPECIFY THE INITIAL VELOCITY" 

116 PRINT "OF fl BALL THROWN STRAIGHT UP, AND THE COEFFICIENT OF" 

120 PRINT "ELASTICITY OF THE BALL. PLEASE USE A DECIMAL FRACTION" 

130 PRINT "COEFFICIENT (LESS THAN 1). • 

131 PRINT 

132 PRINT "VOU ALSO SPECIFY THE TIME INCREMENT TO BE USED IN" 

133 PRINT "'STROBING' THE BALL' S* FLIGHT (TRY .1 INITIALLY) " 

134 PRINT 

135 PRINT "TIME INCREMENT (SEC)".; 

136 INPUT S2 
140 PRINT 

150 PRINT "VELOCITY (FPS)".; 

160 INPUT V 

165 PRINT 

170 PRINT "COEFFICIENT"; 

130 INPUT C 

184 PRINT 

135 PRINT "FEET" 

186 PRINT 

18? Sl= I NT < 70/ < V/ ( 16*S2 ) ) ) 

190 FOR 1=1 TO SI 

200 T(I)=V*C~(I-1)/16 

210 NEXT I 

220 FOR H=INT(-16*(V/32)~2+V"2/32+. 5) 70 STEP - 5 

221 IF INT(H)OH THEN 225 

222 PRINT H; 
225 L=0 

230 FOR 1=1 TO SI 

240 FOR T=0 TO T<I) STEP S2 

245 L=L+S2 

250 IF ABS<H-(. 5*(-32)*T"2+V*C"( I-1)*T>>>. 25 THEN 270 

260 PRINT TAB(L/S2); "0"; 

270 NEXT T 

275 T=T<I+l>/2 

276 IF -16+T~2+V*C~(I-1)*T<H THEN 290 
280 NEXT I 

290 PRINT 

300 NEXT H 

310 PRINT TAB(l); 

320 FOR 1=1 TO INT(L+1)/S2+1 

330 PRINT ". ";■ 

340 NEXT I 

350 PRINT 

355 PRINT "O"; 

360 FOR 1=1 TO INT(L+. 9995) 

380 PRINT TAB(INT(I/S2)).; I; 

390 NEXT I 

400 PRINT 

410 PRINT TAB(INT(L+l)/(2*S2>-2); "SECONDS" 

420 PRINT 

430 GO TO 135 

440 END 

READV 



BOUNCE EDUSYSTEM 30 

THIS SIMULATION LETS YOU SPECIFY THE INITIAL VELOCITY 
OF fl BALL THROWN STRAIGHT UP, AND THE COEFFICIENT OF 
ELASTICITY OF THE BALL. PLEASE USE A DECIMAL FRACTION 
COEFFICIENT (LESS THAN 1). 

YOU ALSO SPECIFY THE TIME INCREMENT TO BE USED IN 
'STROBING' THE BALL'S FLIGHT (TRY .1 INITIALLY). 

TIME INCREMENT (SEC)?. 1 

VELOCITY <FPS)?30 

COEFFICIENT?. 9 

FEET 

14 000 


13 

12 

00 
11 



10 



9 0000 



8 



7 



6 


5 



4 

30 



2 

1 




9 1 2 3 4 '"'"'' 5 " " 

SECONDS 

TIME INCREMENT (SEC)? 
READY 



47 



BOWL 



BOWLING GAME 



Description 



This is a simulated bowling game for up to four players. 
You play 10 frames. To roll the ball, you simply type 
"ROLL". After each roll, the computer will show you a 
diagram of the remaining pins ("0" means the pin is down, 
" + " means it is still standing), and it will give you a 
roll analysis: 

GUTTER 

STRIKE 

SPARE 

ERROR (on second ball if pins still standing) 

Another considerably simpler bowling game was submitted by 
Bion Rogers and Mark Gustitus of Springfield, PA; it is 
not published. 

Program Author 

Paul Peraino 

Woodrow Wilson High School 

San Francisco, CA 94134 




H3^_. 



48 



PROGRAM LISTING 



SAMPLE RUN 



00 REMARK AND ORIGINAL I0EA" AMD PROGRAMED 8? PAUL PERAfNu 
180 REMARK FROM WOODROW WILSON HIGH SCHOOL 
i7Z DIM C<15),A(100,6) 
360 PRINT "WELCOME TO THE ALLEY" 
450 PRINT "BRING YOUR FRIfcNDS" 
540 PRINT "OKAY LET'S FIRST GET ACQUAINTED" 
630 PRINT\PRINT\PRINT 

720 PRINT "WANT INSTRUCTIONS (V OR N)"l 
810 INPUT Z$ 
900 IF Z$«»Y» THEN 990 
IF ZS«»N« THEN 1530 
PRINT "THE GAME OF BOWLING TAKES MIND AND SKILL. DURING THE GAME" 

PRINT "THE COMPUTER WILL KEEP SCORE, YOU May COMPETE WITH" 

PRINT "OTHER PLAYERS tUP TO FOUR], YOU WILL BE PLAYING TEN FRAMES" 

PRINT "ON THE PIN DIAGRAM »0» MEANS THE PIN IS DOWN,,,'*' MEANS THE" 

PRINT "PIN IS STANDING/AFTER THE GAME THE COMPUTER WILL SHOW YOUR" 

PRINT "SCORtS ,» 

PRINT "FIRST OF ALL,, .HOW MANY ARE PLAYING"! 

INPUT R 

PRINT 

PRINT "VERY GOOD..." 

MAT A«ZER 

*«1 

FOR P»l TO R 

M«0 

B«l 

2342 M«0\Q«0 
2430 MAT C*ZER 

2520 REMARK BALL GENERATOR USING MOD '15' SYSTEM 
2610 PRINT "PLAYER»P" -- TYPE ROLL" 
2700 INPUT N$ 
2790 K«0\D*0 
2080 FOR I«l TO 20 

XPINT(RND(I)*100), 

FOR J«l TO 10 

IF X<15*J THEN 3330 

NEXT J 



960 
990 
1080 
1170 

1260 
1350 

1440 
1530 
1620 
1710 
1800 
1890 
1980 
2070 
2160 
225? 



2970 

3060 

3150 

3240 

3330 C(15*J-X)M 

3420 NEXT I 

3510 REMARK PIN DIAGRAM 

360IS PRINT "PLAYER»"P« f-RAMEl»F« 

3690 FOR I«0 TO 3 

PRINT 

FOR J«l TO 4-1 

K*K+1 
IF C(K)«1 THEN 4320 

PRINT TAB(I)!"* »f 

GOTO 4410 

PRINT TAB(I)?"0 »i 

NEXT J 

NEXT I 
4590 PRINT\PRINT\PRINT 
4680 RtMARK ROLL ANALYSIS 
4770 FOR I«l TO 10 
4860 D«D+C(I) 
4950 NEXT I 

IF D-M <> THEN 5220 

PRINT "GUTTER!!" 
IF NOT(B«x anu P«10) THEN 5490 

PRINT "STRIKEIUU" 

Q"3 
IF N0T(B«2 AND D«10) THEN 5760 

PRINT "SPAREUU" 

Q«2 

5760 IF N0T(B«2 AND D<10) THEN 603£ 
5850 PRINT "ERROR J 11" 

Q"l 
IF NQTCBM AND D<10) THEN 6210 

PRINT "ROLL YOUR 2ND BALL" 

REMARK STORAGE OF THE SCORES 

PRINT 
A(F*P,B)«D 

IF B»2 THEN 7020 

8*2 

M*D 

IF Q«3 THEN 6210 
68«0 A(F*P,3)»D*M 
6930 IF Q«0 THEN 2520 
7020 ACF*P,3)«Q 
7110 NEXT P 
7200 F«F*1 

7290 IF F<11 THEN 2070 
7295 PRINT "FRAMES" 

FOR I«l TO 10 

PRINT II 

NEXT I 

PRINT 

FOR P«l TO R 

FOR I«l TO 3 

FOR J«l TO 10 
8010 PRINT ACJ#I)I 
8100 NEXT J 

PRINT 

NEXT I 

PRINT 

NEXT P 

PRINT "DO YOU WANT ANOTHER GAME" 

INPUT A$ 
8640 IF A$««'Y" THEN 2610 
8730 END 



BALLI"B 



3780 
3870 
3960 
4050 
4140 
4230 
4320 
4410 
4500 



5040 
5130 
5220 
5310 
5400 
5490 
5580 
5670 



5940 
6030 
6120 
6210 
6300 
6390 
6480 
6570 
6660 
6750 



7380 
7470 
7560 
7650 
7740 
7830 
7920 



8105 
8190 
8280 
8370 
8460 
8550 



WELCOME TO THE ALLEY 

BRING VOUR FRIENDS 

OKflV LET'S FIRST GET ACQUAINTED 



WANT INSTRUCTIONS <V OR N>? V 

THE GAME OF BOWLING TAKES MIND AND SKILL. DURING THE GAME 

THE COMPUTER WILL KEEP SCORE. VOU MAY COMPETE WITH 

OTHER PLflYERSE UP TO FOUR J. YOU WILL BE PLAYING TEN FRAMES 

ON THE PIN DIAGRAM ' 0' MEANS THE PIN IS DOWN. . . ' +' MEANS THE 

PIN IS STANDING. AFTER THE GAME THE COMPUTER' WILL SHOW YOUR 

SCORES 

FIRST OF ALL. . . HOW MANY ARE PLAYING? 2 



TYPE ROLL 



VERY GOOD. 
PLAVER 1 
? ROLL 
PLAYER: 1 



+ 







ROLL YOUR 2ND BALL 

PLAYER 1 — TYPE ROLL 

? ROLL 

PLAYER: 1 FRAME: 1 

+ 

+ 







PLAYER 2 — TYPE ROLL 

? ROLL 

PLAVER: 2 FRAME: 1 





+ 





ROLL YOUR 2ND BALL 

PLAYER 2 — TYPE ROLL 

? ROLL 

PLAYER: 2 FRAME: 1 











PLAYER 1 — TYPE ROLL 

? ROLL 

PLAVER: 1 FRAME: 2 

+ 

+ 







ROLL VOUR 2ND BALL 

PLAVER 1 — TYPE ROLL 

? ROLL 

PLAVER: 1. FRAME: 2 











PLAYER 2 — TYPE ROLL 

? ROLL 

PLAVER : 2 FRAME : 2 





+ 





ROLL YOUR 2ND BALL 

PLAVER 2 — TYPE ROLL 

■7 ROLL 

PLAYER: 2 FRAME: 2 













49 



BOXING 



OLYMPIC BOXING MATCH 



Description 



This program simulates a three-round Olympic boxing match. 
The computer coaches one of the boxers and determines his 
punches and defenses, while you do the same for your boxer. 
At the start of the match, you may specify your man's best 
punch and his vulnerability. 

There are approximately seven major punches per round, although 
this may be varied in Statement 185. The best two out of 
three rounds wins. 

Program Author 

Jesse Lynch 

710 South Point Douglas Road 

St. Paul, MN 55119 




50 



PROGRAM LISTING 



00001 

00002 
00003 
00005 
00007 
00010 
00020 
00030 
00040 
00045 
00050 



REM PROGRAM SUBMITTED BY JE8SE LYNCH, ST, PAUL, MN. 
J*0 
L"0 

PRINT "OLYMPIC BOXING — 3 ROUNDS" 
PRINT 

PRINT "INPUT YOUR OPPONENT'S NAME" 
INPUT JS 

PRINT "INPUT YOUR MANiS NAME" 
INPUT LS 
PRINT 

PRINT "DIFFERENT PUNCHES ARE 1 FULL SWING 2 HOOK 3 UPPErCUT 4 JAB" 
PRINT "WHAT IS YOUR MANS BEST«I 
INPUT B 

PRINT "AND WhAT IS HIS VULNERABILITY"! 
INPUT D 
00085 PRINT 

B1«INT(4*RND*1) 

Dl«INTU*RND*D 

IF Bi-Dl THEN 90 

PRINT J$" ADVANTAGE Is "81 

FOR R«i TO 3 

IF J>« 2 THEN 1040 

IF L>«2 THEN 1060 



00064 
00070 



00100 
00110 
00120 
00130 
00140 
00150 
00160 
00170 
00175 
00180 
00181 
00185 
00190 
00200 
00210 
00220 
00221 
00222 
00225 
00230 
00240 
00250 
00270 
00271 
00275 
00280 
00290 
00300 
00310 
00330 
00340 
00341 
00345 
00350 
00360 
00375 
00380 
00390 



AND DISADVANTAGE IS SECRET" 



00410 

00420 
00425 
00440 



00455 
00460 
00470 
00475 
00460 
00490 
00500 
00510 
00520 
00530 
00540 
00550 
00560 
00565 
00570 
00580 
00590 



00601 
00602 
00605 
00610 
00620 
00630 



00645 
00650 
00655 
00660 
00670 
00690 



00710 
00720 
00730 
00740 
00745 
00750 
00760 
2d772 
00780 
00790 
00600 
00810 
00820 
00830 
00835 
00840 
00850 



00865 
00870 
00880 
00890 
00900 
00910 
00920 



X-0 

Y»0 

PRINT 

PRINT "ROUND "R" BEGINS,,," 

PRINT «" 

FOR Rls 1 TO 7 

I«INT(10 *RND*1) 

IF I>5 THEN 600 

PRINT L$ »'S PUNCH«| 

Input p 

if p»b then 225 

GO TO 230 

X*X + 2 

IF P«i THEN 340 . 

IF P»2 THEN 450 

IF p«3 THEN 520 

PRINT L$ "JABS AT «J$«S HEAD "J 

IF DIM THEN 290 

C»INT(8*RND+1) 

IF C<4 THEN 310 

X*X + 3 

GO TO 950 

PRINT "ITS BLOCKED" 

GO TO 950 

PRINT L$ " SWINGS AND "J 

IF DIM THEN 410 

X3 «INT(30 *RND*1) 

IF X3<10 THEN 410 

PRINT " HE MISSES "J 

IF X"l THEN 950 

PRINT 

PRINT 

GO TO 300 

PRINT "HE CONNECTS}" 

IF X>35 THEN 980 

X«X+15 

GO TO 300 

PRINT LS "GIVES THE HOOK "I 

IF Dl«2 THEN 480 

HI ■INT(2*RND*1) 

IF Hl«l THEN 50? 

PRINT "CONNECTS,.," 

X*X + 7 

GO TO 300 

PRINT "BUT IT'S BLOCKED IIHIUUI" 

GO TO 300 

print ls " tries an uppercut "i 
if di«3 then 570 
d5»intc100*rnd+1) 

IF D5<51 THEN 570 

PRINT " AND IT'S BLOCKED (LUCKY BLOCKJ)" 

GO TO 300 

PRINT "AND HE CONNECTSI" 

X«X + 4 

GO TO 300 

J7 »INTC**RND+1) 

IF J7 -Bl THEN 605 

Go TO 610 

Y«Y*2 

IF J7.1 THEN 720 

IF J7«2 THEN 810 

IF J7 «3 THEN 860 

PRINT J$« JABS AND" I 

IF DM. THEN 700 

Z4 »INTC7*RND*1) 

IF Z4>4 THEN 690 

PRINT » IT'S BLOCKED J" 

GO TO 300 

PRINT « BLOOD SPILLS 111" 

Y«Y*5 

GO TO 300 

PRINT J$« TAKES A FULL SWING AND«I 

IF D«l THEN 770 

R6»INT(60*RND*t) 

IF R6 <30 THEN 77Z 

PRINT " BUT IT'S BLOCKED |« / 

GO TO 300 

PRINT " POWlUll HE HITS HIM RIGHT In THE FACEI" 

IF Y>35 THEN 1010 

Y«Y*15 

GO TO 300 

PRINT J$" GETS «L$" IN THE JAW (OUCH1)" 

Y«Y*7 

PRINT «,,,,AND AGAIN!" 

Y«Y*5 

IF Y>35 THEN 1010 

PRINT 

PRINT L$ " IS ATTACKED BY AN U p PERCUT (OH, OH),,, 

IF DO THEN 890 

Q4«INT(200*RND*1) 

IF Q4>75 THEN 920 

PRINT " AND "JS" CONNECTS,,," 

Y»Y*8 

GO TO 300 

PRINT « BLOCKS AND HITS "J$« WITH A HOOK," 



00930 X*X + 5 
00940 GO TO 300 

00950 NEXT PI 

00951 IF X>Y THEN 955 

00952 PRINT JS « WINS ROUND "R 

00953 J»J4-1 

00954 GO TO 960 

00955 PRINT L$ " WINS ROUND "R 

00956 L«L+1 

00960 NEXT R 

00961 IF J>» 2 THEN 1040 

00962 IF L>"2 THEN 1060 

0098i PRINT JS « IS KNOCKED CqLO AND " L$" IS THE WINNER AND CHAMP »> 

01000 GO TO 1080 

01010 PRINT L»- M IS KNOCKED COLD AND » JS" IS ThE WINNER 'AND CHAMP "> 

01030 GO TO 1000 

01040 PRINT JS " WINS (NICE GOING )» J$ 

01050 60 TO 1000 

01060 PRINT LS " AMAZINGLY WINS « 

01070 GO TO 1000 

01080 PRINT 

01085 PRINT 

01090 PRINT "AND NOW GOODBYE FROM THE OLYMPIC ARNEA." 

01100 PRINT 

01110 END 



SAMPLE RUN 

RUN BOEING 
OLYMPIC BOXING — 



ROUNDS 



INPUT VOUR OPPONENT- S NAME 

? MEATHEAD 

INPUT VOUR MAN'S' NAME 

? SUPERMAN 

DIFFERENT PUNCHES APE 1 FULL SWING 2 HOOK 2 UPPERCUT 4 JAB 

WHAT IS VOUR MANS, BEST? 2 

AND WHAT IS HIS VULNERABILITV? 2 



meathead' s ^advantage is 

round 1 begins... > 

superman's punchy 2 
5 u p e rm a n give s ' t he ho k . . 
superman gives the hook.. 
. . . .And again* 



AND VULNERABILITV IS SECRET 



SUPERMAN-' S PUNCH? 2 

MEATHEAD GETS SUPERMAN IN THE JAW (OUCH!) 



51 



SUPERMAN IS ATTACKED BY AN UPPERCUT : (OH, OH)... 

AND MEATHEAD CONNECTS. . . 
riEATHE AD GETS SUPERMAN IN THE JAW (OUCH ! ) 

... AND AGAIN! 

SUPERMAN IS ATTACKED BV AN UPPERCUT (OH, OH)... 

AND MEATHEAD CONNECTS. 
SUPERMAN'S PUNCH? 1 
SUPERMAN SWINGS AND HE MISSES 

SUPERMAN'S PUNCH? 1 

SUPERMAN SWINGS AND HE CONNECTS ! 

SUPERMAN'' S PUNCH? 1 

SUPERMAN SWINGS AND HE MISSES 

MEATHEAD WINS ROUND 1 

ROUND 2 BEGINS. . . 

MEATHEAD TAKES A FULL SWING AND POW ! ! ! ! ! HE HITS HIM RIGHT IN THE FACE! 
MEATHEAD GETS SUPERMAN IN THE JAW (OUCH!) 
.... AND AGAIN! 

SUPERMAN IS ATTACKED BV AN UPPERCUT (OH, OH). . . 

AND MEATHEAD CONNECTS. . . 
MEATHEAD TAKES A FULL SWING AND POW!!!!! HE HITS HIM RIGHT IN THE FACE! 
MEATHEAD GETS SUPERMAN IN THE JAW (OUCH!) 
.... AND AGAIN! 
SUPERMAN IS KNOCKED COLD AND MEATHEAD IS THE WINNER AND CHAMP 

FIND NOW GOODS VE FROM THE OLYMPIC ARNEA: 



BUG 



Description 



DRAW A BUG VS THE COMPUTER 



The object of this game is to finish your drawing of a bug 
before the computer finishes his. You and the computer roll 
a die alternately with each number standing for a part of 
the bug. You must add the parts in the right order; in other 
words, you cannot have a neck until you have a body, you 
cannot have a head until you have a neck, and so on. After 
each new part has been added, you have the option of seeing 
pictures of the two bugs. 

If you elect to see all the pictures, this program has the 
ability of consuming well over six feet of Teletype paper 
per run. We can only suggest recycling the paper by using 
the other side. 

Program Author 

The author of this program is in the 7th grade at Harrison 
Junior-Senior High School. 

Brian Leibowitz 
27 Danner Avenue 
Harrison, NY 10528 




52 



PROGRAM LISTING 



10 

20 

30 

40 

50 

60 

70 

80 

90 

100 

110 

120 

130 

140 

1 9 

160 

170 

180 

190 

200 

210 

220 

230 

240 

250 

260 

270 

280 

290 

300 

310 

320 

330 

340 

350 

360 

370 

380 

390 

400 

410 

420 

430 

440 

450 

460 

470 

480 

490 

500 

510 

520 

530 

540 

550 

560 

570 

580 

590 

600 

610 

620 

630 

640 

650 

660 

570 

680 

690 

700 

710 

720 

730 

740 

750 

760 

777i 

780 

790 

800 

810 

820 

830 

840 

850 

860 

870 

880 

890 

900 

910 

920 

930 

940 

950 

960 

970 

980 

990 

1000 

1010 

1020 

1030 

1040 

1050 

1060 

1070 

1080 

1090 

1100 

1110 

1120 

1130 

1140 

1150 

1160 

1170 

1180 

1190 

1200 

1210 

1220 



PRINT 
PRINT 



PRINT 
PRINT 



REM BRIAN MONTE LEIBOWITZ GRADE 7 
REM HARRISON JR, SR. HIGH SCHOOL 
REM HARRISON N.Y. 
DIM ZSC33 
A«B*H»LbN«PbQ«R«SbT«U«V"Ym0 

print "the game bug is like the game cooti," 

print "i hope you enjoy this game" 

print 

print "do you want instructions" i 

INPUT Z$ 

ip z$""no" then 300 

print "The object of bug is to finish your bug before i finish mine" 
"each number stands for a part of the bugs body" 

"I WILL ROLL THE DIE FOR YOU, TFLL YOU WhaT I ROLLED FOP YOU" 

PRINT "WHAT THE NUMBER STANDS FOR, AND IF YOU CAN GET THE PART," 

PRINT "IF YOU CAN GET THE PART I WILL GIVE IT TO YOU." 

PRINT "THE SAME WILL HAPPEN ON MY TURN" 

PRINT "IF THERE IS A CHANGE IN EITHER BUG I WILL GIVE YOU THE " 

PRINT "OPTION OF SEEING THE PICTURES OF THE BUGS," 

PRINT "THE NUMBERS StAND FOR PARTS AS FOLLQwSl" 

print "Number", "part", "Number of part needed" 

PRINT «l",»8oDy","l" 
PRINT "2", "NECK"," 1" 
PRINT "3", "HEAD", "1" 

4",«FEE|_ERS",«2" 

5", "TAILS"!" 
PRINT "6", "LEGS", "6" 
PRINT 
PRINT 

IF Y>0 THEN 2480 
LET z«INT(6*RND(0)*l) 
C»t 

PRINT "YOU ROLLED A »Z 
GOTO Z OF 350,430,540,650,760,870 
PRINT "leBODY" 
IF B«l THEN 410 
PRINT "YOU NOW HAVE A BODY" 
B*i 
C*0 

GOTO 970 

PRINT "YOU DO NOT NEED A BODY" 
GOTO 970 
PRINT »2«NECK* 
IF N«i THEN 500 
IF B*0 THEN 520 

print "you now have a n eck» 

N"l 
Cs0 

GOTO 970 

PRINT "YOU DO NOT NEED A NECK" 
GOTO 970 

PRIN T «yOu DO NOT HAyE A BODy" 
GOTO 970 
PRINT "IsHEAD" 
jF N«0 THEN 610 
IF H*l THEN 630 
PRINT "YOU NEEDED A HEAD" 
Hsl 
C«0 

GOTO 970 

PRIN T "yOu DO NOt HAyE A NECK" 
GOTO 970 

PRINT "YOU HAVE A HEAD" 
GOTO 97? 

PRjNT "4s F EElERS" 
IF H«0 THEN 740 
IF A*2 THEN 720 

PRINT "I NOW GIVE YOU A FEELER" 
LET A«A+l 
C*0 

GOTO 970 

PRINT "YOU HAVE Two FEELERS ALREADY" 
GOTO 970 

PRINT "YOU DO NOT HAVE A HEAD" 
GOTO 970 
PRINT "5BTAIL" 
IF B*0 THEN 830 
IF T*i THEk; 850 
PRINT "I NOW GIVE YOU A TAIL" 
LET T«T + 1 
C«0 

GOTO 970 

PRINT "YOU DO NOT HAVE A BODY" 
GOTO 970 

PRINT "YOU ALREADY HAVE A TAIL" 
GOTO 970 
PRINT "6*LEG« 
IF L»6 THEN 940 
IF B«0 THEN 960 
LET L 8 L+1 
C«0 

PRINT "YOU NOW HAVE "L" LeG(S)" 
GOTO 970 

PRINT "YOU HAVE 6 FEET ALREADV" 
GOTO 970 

PRINT "YOU DO NOT HAVE A BODY" 
LET X«INT(6*RND(0)+1) 
PRINT "I ROLLED A "X 

GOTO X OF 1000,1080,1190,1300,1410,1520 
PRINT "1«BqDY« 

if p«i then 1060 

print "i now have a body" 

C»0 

P«l 

GOTO 1630 

PRINT "I DO NOT NEED A BODY" 

GOTO 1630 



PRINT "2»NECK« 

IF q«1 THEN 1150 

IF p»0 THEnj 1170 

PRINT "I NOW HAVE A NEC«" 

(3*1 

C«0 

GOTO 1630 

PRINT "I DO NOT NEED A NECK" 

GOTO 1630 

PRINT "I DO NOt HAvE A BODY" 

GOTO 1630 

PRINT "3«HEAD« 

IF Q»0 THEN 1260 

IP R«i THEN 1280 

PRINT "I NEEDED A HEAD" 



53 



1230 
1240 
1250 
1260 
1270 
1280 
1290 
1300 
1310 
1320 
1330 
1340 
1350 
1360 
1370 
1380 
1390 
1400 
1410 
1420 
1430 
1440 
1450 
1460 
1470 
1480 
1490 
1500 
1510 
1520 
1530 
1540 
1550 
1560 
1570 
1580 
1590 
1600 
1610 
1620 
1630 
1640 
1 6 50 
1660 
1670 
1680 
1690 
1700 
1710 
1720 
1730 
I740 

1750 
1760 
1770 
1780 
1790 
1800 
1810 
1820 
1830 
1840 
1850 
I860 
1870 
1880 
1890 
1900 
1910 
1920 
1930 
1940 
1950 
1960 
1970 
1980 
1990 
2000 
2010 
2020 
2030 
2040 
2050 
2060 
2070 
2080 
2090 
2100 
2110 
2120 
2130 
2140 
2150 
2160 
2170 
2180 
2190 
2200 
2210 
2220 
2230 
2240 
2250 
2260 
2270 
2280 
2290 
2300 
2310 
2320 
2330 
2340 
2350 
2360 
2370 
2380 
2390 
2400 
2410 
2420 
2430 
2450 



R«l 

C»0 

GOTO 1 
PRINT 
GOTO 1 
PRINT 
GOTO 1 
PRINT 
IF R«0 
IF S"2 
PRINT 
LET S« 
C>0 

GOTO 1 
PRINT 
GOTO 1 
PRINT 
GOTO 1 
PRINT 
IF P«0 
IF U"l 
PRINT 
U*l 
C»0 

GOTO 1 
PRINT 
GOTO 1 
PRINT 
GOTO 1 
PRINT 
IF V*6 
IF P«0 
LET V« 
C«0 
PRINT 
GOTO 1 
PRINT 
GOTO 1 
PRINT 
GOTO 1 
IF A»2 
GOTO 1 
PRINT 
LET Y« 
IF S« 2 
GOTO 1 
PRINT 
LET Y« 
IF C*l 
PRINT 
INPUT 
IF Z$* 
PRINT 
PRINT 
PRINT 
IF A»0 
FOR Z« 
FOR X« 
PRINT 
PRINT 
NEXT X 
PRINT 
NEXT Z 
IF H«0 
GOsuB 
IF N«0 
FOR Z* 
PRINT 
NEXT Z 
IF B»0 
PRINT 
FOR Z« 
PRINT 
NEXT Z 
IF T*l 
PRINT 
PRINT 
IF L«0 
FOR Z« 
PRINT 

for x* 

PRINT 
NEXT X 
PRINT 
NEXT Z 
FOR Z* 
PRINT 
NEXT Z 
PRINT 
PRINT 
PRINT 
PRINT 
IF S*0 
FOR 2* 
PRINT 
FOR X» 
PRINT 
NEXT X 
PRINT 
NEXT Z 
IF R#l 
GOSUB 
IF QB0 
PRINT 
PRINT 
IF P*0 
PRINT 
FOR Z* 
PRINT 
NEXT Z 
IF U#l 
PRINT 
PRINT 
IF V«0 
FOR Z« 
PRINT 
FOR X« 
PRINT 
NEXT X 
PRINT 
NEXT Z 
IF Y*0 



630 

"I DO NOT HAVE A NECK" 

630 

"I DO NOT NEED A HEAD « 

630 

•UbFEELERS" 

THEN 1390 

THEN 1370 
"I GET A FEELER" 
S+l 

630 

"I HAVE 2 FEELERS ALREADY" 

630 

"I DO NOT HAVE A HEAD" 

630 

5«TA1L" 

THEN 1480 

THEN 1500 

I NOW HAVE A TAIL" 



630 

"I DO NOT HAVE A BODY" 

630 

"I DO NOT NEED A TAIL" 

630 

"6*LEGS" 

THEN 1590 

THEN 1610 
V+l 

"I NOW HAVE "V" LEGC3)" 
630 

I HAyE 6 FEET" 
630 

I DO NOT HAVE A BqDY" 
630 

AND T«l AND L"6 ThEN 1650 
670 

"YOUR BUG IS FINISHED" 
Y+l 

AND P«i AND V«6 THEN ^90 
710 

«my bug is finished" 

Y*2 

THEN 300 
"DO YOU WANT ThE PICTURES"! 
Z$ 

"NO" THEN 300 
"*****YQUR BUG*****" 



THEN I860 
1 To 4 
1 TO A 
TAB(10)I 
"A "; 



THEN 1880 
2470 

THEN 1920 
1 TO 2 
it M kjii 

THEN 2000 
" BBBR8BBBBBB8" 
1 TO 2 
« B 6" 

THEN 1990 
"TTTTTB B« 

" BBBBBBBBBBBB" 

THEN 2080 
1 TO 2 
TA8(5)» 
1 TO L 
" L"> 



1 TO 4 

»>**#***my Bug*******" 



THEN 223? 
1 TO 4 
TABf 10)1 
1 TO S 

"F "; 



THEN 2250 
2470 

THEN >2280 
" N N" 

ii N N" 

THEN 2360 
" BBBBBBBBBBBB" 
1 TO 2 

8 B« 

THEN 2350 
"TTTTTB 6" 

" BBBBBBBBBBBB" 

THEN 2450 
1 TO 2 
TAB(5)j 
1 TO V 



246(9 


GOTO 300 




2470 


PRINT " HHHHMHH" 




2400 


PRINT M H H" 




2 4 90 


PRINT « HOOH" 




2500 


PRINT " H H« 




2510 


PRINT « H V H" 




2520 


PRINT » HHHHHHHii 




2530 


RETURN 




2540 


PrINj "I HOPE YOU ENJOYED THE GAME, 


PLAY AGAIN SOON ||i 


2550 


END 





THE GAME BUG IS LIKE THE GAME COOT I, 
I HOPE YOU ENJOY THIS GAME 



SAMPLE RUN 



DO YOU WANT INSTRUCTIONS? YES 

THE OBJECT OF BUG IS TO FINISH YOUR BUG BEFORE I FINISH MINE 

EACH NUMBER STANDS FOR A PART OF THE BUGS BODY 

I WILL ROLL THE DIE FOR YOU.. TELL YOU. WHAT I ROLLED FOR YOU 

WHAT THE NUMBER STANDS FOR, AND IF YOU CAN GET THE PART. 

IF YOU CAN GET THE PART I WILL GIVE IT TO YOU. 

THE SAME WILL HAPPEN ON MY TURN 

IF THERE IS A CHANGE IN EITHER BUG I WILL GIVE -YOU THE 

OPTION OF SEEING THE PICTURES OF THE BUGS. 

THE NUMBERS STAND FOR PARTS AS FOLLOWS : 

NUMBER PART NUMBER OF PART NEEDED 

1 BODY 1 

2 NECK 1 

3 HEAD 1 

4 FEELERS 2 

5 TAIL 1 

6 LEGS 6 



YOU ROLLED A 5 

5-TAIL 

YOU DO NOT HAVE A BODY 

I ROLLED A 5 

5= TAIL 

I DO NOT HAVE A BODY 

YOU ROLLED A 5 

5=TAIL 

YOU DO NOT HAVE A BODY 

I ROLLED A 3 

3=HEAD 

I DO NOT HAVE A NECK 

YOU ROLLED A 1 

l=BODY 

YOU NOW HAVE A BODY 

I ROLLED A 2 

2=NECK 

I DO NOT HAVE A BODY 

DO YOU WANT THE PICTURES? NO 

YOU ROLLED A 4 

4=FEELERS 

YOU DO NOT HAVE A HEAD 

I ROLLED A 2 

2=NECK 

I DO NOT HAVE A BODY 

YOU ROLLED A 6 

6=LEG 

YOU NOW HAVE 1 LEG(S> 

I ROLLED A 3 

3=HEAD 

I DO NOT HAVE A NECK 

DO YOU WANT THE PICTURES? YES 

***hc#Y0UR BUG***** 



B B 

BBBBBBBBBBBB 



****** fly BUG*** 



******Piy BUG******* 



HHHHHHH 

H H 

H H 

H H 

H V H 

HHHHHHH 
N N 
N.N 
BBBBBBBBBBBB 
B B 

B B 

TTTTTB B 

BBBBBBBBBBBB 
L L L L L L 
L L L L L L 
YOU ROLLED A 4 
4=FEELERS 

YOU HAVE TWO FEELERS ALREADY 
I ROLLED A 4 
4=FEELERS 
I GET A FEELER 

DO YOU WANT THE PICTURES? NO 
YOU ROLLED A 5 
5=TRIL 

YOU ALREADY HAVE A TAIL 
I ROLLED A 1 
l=BODY 

I DO NOT NEED A BODY 
YOU ROLLED A 4 
4=FEELERS 

YOU HAVE TWO FEELERS ALREADY 
I ROLLED A 1 
l=BODY 

I DO NOT NEED A BODY 
YOU ROLLED A 5 
5=TAIL 

YOU ALREADY HAVE A TAIL 
I ROLLED A 5 
5=TAIL 

I DO NOT NEED A TAIL 
YOU ROLLED A 5 
5=TAIL 

YOU ALREADY HAVE A TAIL 
I ROLLED A 2 
2=NECK 

I DO NOT NEED A NECK 
YOU ROLLED A 4 
4=FEELBRS 

YOU HAVE TWO FEELERS ALREADY 
I ROLLED A 4 
4=FEELERS 
I GET A FEELER 
MY BUG IS FINISHED 
DO YOU WANT THE PICTURES? YES 
* * * * * y U R B U G * * * * * 







A 


A 










A 


A 










A 


A 










A 


A 








HHHHHHH 






H 






H 






H 








H 






H 






H 






H 


V 


H 






HHHHHHH 








N 


N 










N 


N 






BBBBBBBBBBBB 


B 










B 


B 










B 


TTTTTB 










B 


BBBBBBBBBBBB 


L 


L 


L 


L 


L 




L 


L 


L 


L 


L 





YOU ROLLED A3 

3=HEAD 

YOU DO NOT HAVE A NECK 

I ROLLED A3 

3=HEAD 

I DO NOT HAVE A NECK 

YOU ROLLED A 1 

l=BODY 

YOU DO NOT NEED A BODY 

I ROLLED A 1 

l=BODY 

I NOW HAVE A BODY 

DO YOU WANT THE PICTURES? NO 

YOU ROLLED A 1 

l=BODV 

YOU DO NOT NEED A BODY 

I ROLLED A 6 

6=LEGS 

I NOW HAVE 1 LEG<S> 

DO YOU WANT THE PICTURES? NO 

YOU ROLLED A 6 

6=LEG 

YOU NOW HAVE 2 LEG<S) 

I ROLLED A 2 

2=NECK 

I NOW HAVE A NECK 

DO YOU WANT THE PICTURES? NO 



* * * * * * m y B U G * * * * * * * 



F F 



F F 

F F 
HHHHHHH 
H H 
HOOH 
H H 



H 



H 



HHHHHHH 

N N 

N N 

BBBBBBBBBBBB 

B B 

B B 

TTTTTB B 

BBBBBBBBBBBB 

L L L L L L 

L L L L L L 

I HOPE YOU ENJOYED THE GAME, 

READY 



PLAY AGAIN SOON 



54 



BULCOW 



BULLS AND COWS GUESSING GAME 



Description 



In this game, a somewhat advanced version of BAGLES, the idea 
is that each player (you and the computer) tries to guess a 
5-digit number thought up by the opposing player. A BULL is 
scored for each correct digit in the correct position and a 
COW for each correct digit but out of position. For example: 



Mystery number 
Your guess 



51340 

21734 scores 1 BULL and 2 COWS 



In the first sample run, the human player's mystery number was 
12345. In the second run, the number was 13579. Notice that 
on the fourth computer guess , 35719, the human player told the 
computer 0,5 (i.e., no BULLS and 5 COWS) . This was incorrect; 
it should have been 1,4 , but the computer could not know that 
until two turns later when it realized that the human had given 
it impossible scores. 

By about the fourth or fifth guess, the computer starts taking 
quite a bit of time to narrow its choices between guesses. 
Be patient. 

Program Author 

Geoff Wyvill 
Bradford University 
Bradford, Yorkshire, England 



v..> 









55 



PROGRAM LISTING 

5 G0SUB588 

10 DIMD<10,4>,B<10>/C<18>,G<10> 

15 RANDOMIZE: PR I NT: PR I NT: PR I NT 

29 LETA=0:GOTO200 

30 PR I NT : PR I NT: PR I NT: LET J*0 

35 PRINT»VOUR GUESS".: : INPUTN : LETN*<N+. 1 )/188888 

40 F0RI*8T04:LETG<I)=INT<18*N> :LETN=18*N-INT<18*N> 

41 FORK=»0TOI~1; IFG<I>=GaOG0T0178 

42 NEXTK 
42 NEXT I 

45 LETP=4:LETfi=8:G0SUB388 

50 PRINTVBULL'j : IFVOITHENPRINT-'S"; 

55 IFV=5THENPP.INT" - VOL! WIN" : G0T028 

60 PRINTW-V'COW"; : IFWOV+iTHENPRINT"S ".: 

65 IFJ=8THENLETA=1 : G0T0288 

68 GOSUB406 

78 PRINT" - MV GUESS IS "■; 

75 F0RI-8T04:PRINTCHR*(D(J.. I)+4S),! :NEXTI 

88 PRINT " MV SCORE " ; : I NPUTB ( J ) , C < J ) : LETC < J > ~C ( J ) +B ( J > 

81 I FB < .J ) >- 1THEN I FB < J K6THEN I FC ( J ) C6THEN I FC < J > -B < J > >~160T083 

82 PRINT" - RIDICULOUS! !";: GOTO 78 

83 IFB<J>=4THENIFC<J>*560T082 

85 IFB<J>=»5THENPRINT" - I WIN - MV NUMBER WAS".: : GOTO100 

98 G0T035 

106 F0RI=8T04:PRINTCHR*<D<8, I>+48>.; :NEXTI 

118 GOTG20 

158 PR I NT .PR I NT "VOU HAVE GIVEN ME IMPOSSIBLE SCORES - GAME SPOILED" 

:G0T0 5 
179 PRINT"REPEflTED DIGITS NOT ALLOWED" ; GOT035 
208 FORP.«0TO4 

210 LETD<A, P>=INT<10*RND(1>> 
220 FORI=0TOP~1: IFDCfl, D=D<ft,P)GOTO210 
230 NEXTI 
240 NEXTP 
250 IFR=0GOTOS@ 
260 LETJ=1:G0T078 
300 LETV-0:LETW»0 

310 FORI=0TOP:IFD(fl, I)=G<I)THENLETV-V+1 
320 FORK=0TO4: IFD<A, K)*Q< I )'THENLETW*W+i 
330 NEXTK 
340 NEXTI 
350 RETURN 
400 LETP=0 
405 LETG<P>=D<J,P> 

410 FORI=0TOP-1: IFG<I>=G<P)GOTO430 
415 NEXTI 

428 FORft=lTOJ:GOSUB380 

425 IFV<*B<fi)THENIFW<»C<fi)THENIF4-P>*C<R)-WTHENI'F4-P>=B<'R-)-VG0T0448 
430 LETG < P > -G < P ) + 3 : I FG < P > >9THENLETG < P ) »G < P > -18 
432 IFP-0THENIFG<P)=D<1, 8)GOTO150 
435 I FG < P > OD < -J, P ) G0T0418 
440 LETP=P-1: IFP<8THENG0T0158 
445 G0T0438 
448 NEXTA 

450 LETP=P+1:IFP<5GOTO405 
455 LETJ-J+1 

460 FORI=0TO4:LETD<J, I)=G<I) :NEXTI 
465 RETURN 
580 PR I NT: PR I NT: PR I NT" BRADFORD UN I VERS I TV BULLS AND COWS GAME 

510 G0T018 
993 END 



SAMPLE RUN 

BRADFORD UN I VERS I TV BULLS AND COWS GAME 



VOUR GUESS? 12345 

8 BULLS 2 COWS - MV GUESS IS 68321 MV SCORE? 1,2 
VOUR GUESS? 34567 

1 BULL 2 COWS - MV GUESS IS 61953 MV SCORE? 8,3 
VOUR GUESS? 67898 

8 BULLS 3 COWS - MV GUESS IS 94231 MV SCORE? 8,4 
VOUR GUESS? 67813 

8 BULLS 3 COWS - MV GUESS IS 27319 MV SCORE? 1,2 
VOUR GUESS? 24678 

3 BULLS COWS - MV GUESS IS 16429 MV SCORE? 1,2 
VOUR GUESS? 25679 

1 BULL 1 COW - MV GUESS IS 19384 MV SCORE? 2,1 
VOUR GUESS? 64378 

2 BULLS 2 COWS - MV GUESS IS 15342 MV SCORE? 2, 3 
VOUR GUESS? 94638 

5 BULLS - VOU WIN 



Our mystery number was 12345 
Computer ' s score is 1 BULL for the 3 
and 2 COWS for the 1 and 2. 



VOUR GUESS? 12345 

1 BULL 1 COW - MV GUESS IS 46898 MV SCORE? 8,1 
VOUR GUESS? 13579 

8 BULLS 2 COWS - MV GUESS IS 79321 MV SCORE? 8, 4 
VOUR GUESS? 24688 

BULLS 3 COWS - MV GUESS IS 82173 MV SCORE? 8,3 
VOUR GUESS? 35688 

BULLS 3 COWS - MV GUESS IS 35719 MV SCORE? 8,5 
VOUR GUESS? 88345 

8 BULLS 2 COWS '- MV GUESS IS 91537 MV SCORE? 8,5 
VOUR GUESS? 23568 

8 BULLS 4 COWS 
VOU HAVE GIVEN ME IMPOSSIBLE SCORES - GAME SPOILED 



Our mystery number was 13579 



This clue was incorrect because the 9 is in 
the right place. Score should have been 1,4. 



56 



BULEYE 



THROW DARTS 



Description 



In this game, up to 20 players throw darts at a target with 
10- , 20-/ 30-, and 40-point zones. The objective is to get 
200 points. 

You have a choice of three methods of throwing: 

Throw Description Probable Score 



1 
2 
3 



Fast overarm 
Controlled overarm 
Underarm 



Bullseye or complete miss 
10 , 20, or 30 points 
Anything 



You will find after playing a while that different players 
will swear by different strategies. However, consider the 
expected score per throw by always using Throw 3 (program 
line 220) : 



Score 


(S) 


Probability (P) 


S x P 


40 
30 
20 
10 





1.00-.95 = .05 
.95-. 75 = .20 
.75-. 45 = .30 
.45-. 05 = .40 
.05-. 00 = .05 


2 
6 
6 

4 




Expected score per throw = 



18 



Calculate the expected scores for the other throws and you 
may be surprised I 

Program Author 

Digital Equipment Corp. 
Maynard, MA 01754 




PROGRAM LISTING 

10 REM*** bdLLSEV. BV DAVE AHL 

20 PRINT "GAME OF 6ULLSEVE"SPkINTSRRND0MIZE 

20 PRINT "IN THIS GAME, UP TO 20 PLAVERS THROW DARTS AT A TARGET" 

40 PRINT 'WITH 10, 26, 30, AND 40 POINT ZONES. THE OBJECTIVE IS" 

50 PRINT "TO L T 200 POINTS. "SPRINT 

60 PRINT "THROW", "DESCRTRTION",, "PROBABLE SCORE" 

70 PRINT " 1", "FAST OV..£ARM", , "BULLSEVE OR COMPLETE MISS" 

80 PRINT " 2", "CONTROLLED OVERARM", "10, 20, OR 30 POINTS" 

30 PRINT " 3", "UNDERARM", , " ANVTH I NG" SPRINT 

100 DIM A* < 20 > , S < 20 > , W (10 > SR, M = OSS < I ) =6 FOR I =1 TO 28 

1.10 INPUT "HOW MANV PLAVERS".; NSPR I NT 

120 FOR 1=1 TO N 

130 PRINT "NAME OF PLAVER" I,- S INPUT A*< I > 

140 NEXT I 

150 R=R+1SPRINTSPRINT " ROUND "R 

160 FOR 1=1 TO N 

170 PR I NTSPR I NT A* < I > " ' S THROW " ; S I NPUT T 

180 IF TC0 OR T>3 THEN PRINT "INPUT 1, 2, OR 3"SG0T0 178 

190 ON T GOTO 200, 210, 228 

200 Pl = . 65SP2=. 55SP2=. 5SP4 = . 5SGGTG 238 

210 Pl = . 99SP2=. 77SP3=. 43SP4=. OlSGOTO 230 

220 Pl=. 95SP2 = . 75SP3- 45SP4=. 05 

230 U=RND 

240 IF U>=P1 THEN PRINT "BULLSEVE!! 48 POINTS !"SB=40SGOTO 298 

250 IF U>=P2 THEN PRINT "38-POINT ZONE ! "SB=38SG0T0 298 

268 IF U>=P3 THEN PRINT "20-POINT ZONE"SB=20SGOTO 298 

270 IF U>=P4 THEN PRINT "WHEW! 18 POINTS. "SB=10SGOTO 298 

288 PRINT "MISSED THE TARGET. TOO BAD!"SB=8 

290 S(I> = S<I> + BSPRINT "TOTAL SCORE ="-£<I>SNEXT I ■ 

300 FOR 1=1 TO N 

310 IF S<I>>=200 THEN M=M+1SW<M>= I 

320 NEXT I 

228 IF M=0 THEN 150 

340 PR I NTSPR I NT "WE HAVE A WINNER !! "SPRINT 

350 PRINT A*<W<«>)" SCORED "SCWtMyV POINTS. " FOR 1=1 TO M 

360 PRINTSPRINT "THANKS FOR THE GAME!"SEND 

READV 



SAMPLE RUN 

GAME OF BULLSEVE 

IN THIS GAME, UP TO 28 PLAVERS THROW DARTS AT A TARGET 
WITH 18, 28, 30, AND 48 POINT ZONES. THE OBJECTIVE IS 
TO GET 200 POINTS. 



DESCRIPTION 
FAST OVERARM 
CONTROLLED OVERARM 
UNDERARM 



PROBABLE SCORE 

BULLSEVE OR COMPLETE MISS 

10, 28, OR 38 POINTS 

ANVTHJ.NG 



HOW MANV PLAVERS? 



NAME OF PLAVER 1 
NAME OF PLAVER 2 



DAVE 
MARV 



DAVE'S THROW? 1 
BULLSEVE! ! 48 POINTS! 
TOTAL SCORE = 100 



DAVE'S THROW? 1 
BULLSEVE! ! 40 POINTS! 
TOTAL SCORE = 40 



MARV'S THROW? 2 
20-POINT ZONE 
TOTAL SCORE = 100 



MARV'S THROW? 1 
20-POINT ZONE 
TOTAL SCORE = 20 



DAVE'' S THROW? 2 
WHEW! 10 POINTS. 
TOTAL SCORE = 110 



DAVE'S THROW? 1 
MISSED THE TARGET. 
TOTAL SCORE = 40 



MARV' S THROW? 2 
WHEW! 18 POINTS. ; 
TOTAL. SCORE = 110 



MARV'S THROW? 1 
BULLSEVE! ! 40 POINTS! 
TOTAL SCORE = 60 



DAVE'S THROW? 2 
20-POINT ZONE 
TOTAL .SCORE = 128 



DAVE'S THROW? 1 
MISSED THE TARGET, 
TOTAL SCORE =40 



MARV'S THROW? 2 
20-POINT ZONE! 
TOTAL SCORE = 140 



MARV'S THROW? 1 
MISSED THE- TARGET. 
TOTAL SCORE =60 



DAVE'S THROW? 1 
BULLSEVE! ! 48 POINTS! 
TOTAL SCORE = 170 



DAVE'S THROW? 3 
WHEW! ,10 POINTS. 
TOTAL SCORE - 5© 



MARV'S THROW? 1 
MISSED THE TARGET. 
TOTAL SCORE = 140 



MARV'S THROW? 3 
20-POINT ZONE 
TOTAL SCORE = 80 



DAVE'S THROW? 1 
BULLSEVE! ! 40 POINTS! 
TOTAL SCORE = 210 



dave's throw? 2 
whew! 10 points, 
total score = 6« 

marv's throw? 2 
missed the Target, 
total score - 80 



MARV'S THROW? 1 

MISSED THE TARGET. TOO 

TOTAL SCORE = 140 

WE HAVE A WINNER! ! 

DAVE SCORED 210 POINTS. 

THANKS FOR THE GAME! 



58 



BULL 



BULLFIGHT 



Description 



In this simulated bullfight, you are the matador— -i.e.,. the 
one with the principal role and the one who must kill the 
bull or be killed (or run from the ring) . 

On each pass of the bull, you may try: 

Veronica (dangerous inside move of the cape) 

1 Less dangerous outside move of the cape 

2 Ordinary swirl of the cape 
Or you may try to kill the bull: 

4 Over the horns 

5 In the chest 

The crowd will determine what award you deserve, posthumously 
if necessary. The braver you are, the better the award you 
receive. It's nice to stay alive too. The better the job 
the picadores and toreadores do, the better your chances. 

This program was converted to standard BASIC (DIGITAL 
Timeshared-8) by students at Lexington High School under 
the direction of Walt Koetke. 

Source 

David Sweet 
Dartmouth College 
Hanover, NH 03755 




PROGRAM LISTING 

10 DIM D(20) 
200 RANDOMIZE 
202 LET L=l 

205 PRINT-DO YOU WANT INSTRUCTIONS"; 

206 INPUT Z$ 

207 IF Z$="NO" THEN 400 

210 PRINT"HELLO, ALL YOU BLOODLOVERS AND AFICIONADOS" 
220 PRINT"HERE IS YOUR BIG CHANCE TO KILL A BULL" 
230 PRINT 

240 PRINT"ON EACH PASS OF THE BULL, YOU MAY TRY" 
250 PRINT"0 - VERONICA (DANGEROUS INSIDE MOVE OF THE CAPE)" 
260 PRINT"1 - LESS DANGEROUS OUTSIDE MOVE OF THE CAPE" 
270 PRINT"2 - ORDINARY SWIRL OF THE CAPE" 
280 PRINT 

290 PRINT"INSTEAD OF THE ABOVE, YOU MAY TRY TO KILL THE BULL" 
300 PRINT"ON ANY TURN: 4 (OVER THE HORNS), 5 (IN THE CHEST)" 
310 PRINT"BUT IF I WERE YOU," 

320 PRINT"I WOULDN'T TRY IT BEFORE THE SEVENTH PASS" 
53Z PRINT 

340 PRINT"THE CROWD WILL DETERMINE WHAT AWARD YOU DESERVE" 
350 PRINT"POSTHUMOUSLY IF NECESSARY" 

360 PRINT"THE BRAVER YOU ARE, THE BETTER THE AWARD YOU RECIEVE" 
370 PRINT 

380 PRINT"THE BETTER A JOB THE PICADORES AND TOREADORES DO," 
390 PRINT"T'HE BETTER YOUR CHANCES ARE" 
400 PRINT 
410 PRINT 
420 LET D(5)=l 
430 LET D(4)=l 
450 DIM L$(5) 
455 LET A=INT(RND(0)*5)+1 
460 FOR 1=1 TO 5 
463 READ L$(I) 
467 NEXT I 

470 DATA "SUPERB", "GOOD", "FAIR", "POOR", "AWFUL" 
490 PRINT"YOU HAVE DRAWN A "L$(A)" BULL" 
500 IF A>4 THEN 530 
510 IF A<2 THEN 550 
520 GOTO 570 
530 PRINF'YOU'RE LUCKY" 
540 GOTO570 

550 PRINT" GOOD LUCK. YOU'LL NEED IT" 
560 PRINT 
5 70 PRINT 

590 LET A$="PICAD0" 
595 LET B$="RES" 
600 GOSUB 1610 
610 LET D(1)=C 
630 LET A$ = "TOREAD" 
635 LET B$="ORES" 
640 GOSUB 1610 
650 LET D(2)=C 
660 LET E=E 
670 PRINT 

680 IF Z=l THEN 1310 
690 LET D(3)=DC3)+1 
700 PRINT"PASS NUMBER "D(3) 
710 IF D(3)<3 THEN 760 

720 PRINT"HERE COMES THE BULL! TRY FOR A KILL"; 
730 GOSUB 1930 
735 ON Zl GOTO 1130,740 
740 PRINT "CAPE MOVE"; 
750 GOTO 800 

760 PRINT"THE BULL IS CHARGING AT YOU! YOU ARE THE MATADOR--" 
770 PRINT"D0 YOU WANT TO KILL THE BULL"; 
780 GOSUB 1930 
785 ON Zl GOTO 1130,790 

790 PRINT"WHAT MOVE DO YOU MAKE WITH THE CAPE"; 
800 INPUT E 

810 IF E<>INT(A3S(E))THEN 830 
820 IF E<3 THEN 850 

830 PRINT"DON*T PANIC, YOU IDIOT! PUT DOWN A CORRECT NUMBER" 
840 GOTO 800 
850 LET D=D 
860 IF E=0 THEN 920 
870 IF E=l THEN 900 
880 LET M=0.5 
890 GOTO 930 
900 LET M=2 
910 GOTO 930 
920 LET M=3 
930 LET L=L+M 

940 LET F=(6-A+M/10)*RND(0)/((D(1)+D(2)+D(3)/1Z)*5) 
950 IF F<0.51 THEN 660 
960 PRINT"THE BULL HAS GORED YOU" 
970 ON FNA(0) GOTO 980,1010 
980 PRINT"Y0U ARE DEAD" 
990 LET D(4)=1.5 
1000 GOTO 1310 

1010 PRINT"YOU ARE STILL ALIVE" 
1020 PRINT"DO YOU RUN FROM THE RING"; 
1030 GOSU3 1930 
1035 ON Zl GOTO 1040,1370 
1040 PR I NT "COWARD" 
1050 LET D(4)=0 
1060 GOTO 1310 

1070 PRINT"YOU ARE BRAVE. STUPID, BUT BRAVE" 
1080 ON FNA(0) THEN 1090,1110 
1090 LET D(4)=2 
1100 GOTO 660 

1110 PRINT"Y0U ARE GORED AGAIN" 
1120 GOTO 970 
1130 LET C=C 
1140 LET Z=l 

1150 PRINT"IT IS THE MOMENT OF TRUTH. HOW DO YOU TRY TO KILL THE 
1160 INPUT H 
1170 IF H=4 THEN 1230 
1180 IF H=5 THEN 1230 

1210 PRINT"YOU PANICKED. THE BULL GORED YOU." 
1220 GOTO 970 

1230 LET K=(6-A)*10*RND(0)/((D(1)+D(2))*5*D(3)) 
1240 IF J=4 THEN 1290 



1250 
1260 
1270 
1280 
1290 
1300 
1310 
1320 
1330 
1340 
1350 
1360 
1370 
1380 
1390 
1400 
1410 
1420 
1430 
1440 
1450 
1460 
1470 
1480 
1500 
1510 
1520 
1530 
1540 
1550 
1560 
1570 
1580 
1590 
1600 
1610 
1620 
1630 
1640 
1650 
1660 
1670 
1680 
1690 
1700 
1710 
1720 
1730 
1740 
1750 
1760 
1770 
1780 
1790 
1800 
1810 
1820 
1830 
1840 
1850 
1860 
1870 
1880 
1890 
1900 
1910 
1920 
1930 
1950 
1960 
1970 
1980 
1990 
2000 
2010 
2020 
2030 

READY 



IF K>0.2 THEN 960 
PRINT"YOU KILLED THE BULL" 
LET D(5)=2 
GOTO 1320 
IF K>0.8 THEN 960 
GOTO 1260 
PRINT 
PRINT 
PRINT 

IF D(4)<>0 THEN 1390 

PRINT"THE CROWD BOOS FOR TEN MINUTES. IF YOU EVER DARE TO SHOW" 
PRINT"YOUR FACE IN A RING AGAIN. THEY SWEAR THEY WILL KILL YOU— " 
PRINT"UNLESS THE BULL DOES FIRST" 
GOTO 1580 

DEF FNC(Q)-(4.5+L/6-(D(l)+D(2))*2.5+4*D(4)+2*D(5)-(D(3)t2)/120-A)*i 
IF D(4)<>2 THEN 1430 
PRINT"THE CROW CHEERS WILDLY" 
GOTO 1450 

IF D(5)<>2 THEN 1450 
PRINT"THE CROWD CHEERS" 
PR I NT "THE CROWD AWARDS YOU "; 
IF FNC(Q)<2.4 THEN 1570 
IF FNC(Q)<4.9 THEN 1550 
IF FNC(Q)<7.4 THEN 1520 

PRINT"OLE! YOU ARE 'MUY HOMBREM OLE! OLE!" 
GOTO 1580 

PRINT"B0TH EARS OF THE BULL- 
PRINT-OLE!" 
GOTO 1580 

PRINT"ONE EAR OF THE BULL" 
GOTO 1580 
PR I NT" NOTHING" 
PRINT 

PR I NT "AD I OS" 
GOTO 2030 
LET B=3/A*RND(0) 
IF B<0.37 THEN 1740 
IF B<0.5 THEN 1720 
IF B<0.63 THEN 1700 
IF 3<0.87 THEN 1680 
LET C=0.1 
GOTO 1750 
LET C=0.2 
GOTO 1750 
LET C=0.3 
GOTO 1750 
LET C=0.4 
GOTO 1750 
LET C=0.5 

LET T = INT(10*C+0.2) 

PRINT"THE "A$;B$" DID A "L$(T)" JOB" 
IF 4>T THEN 1900 
IF 5=T THEN 1870 
ON FNA(K) GOTO 1800,1900 
IF A$="TOREAD" THEN 1820 

PRINT"0NE OF THE HORSES OF THE "A$;B$" WAS GORED" 
ON FNA(K) GOTO 1830,1850 
PRINT"ONE OF THE "A$;B$" WAS KILLED" 
GOTO 1900 

PRINT"NO "A$;3$" WERE KILLED" 
GOTO 1900 

IF A$="TOREAD" THEN 1890 

PRINT FNA(K)" OF THE HORSES OF THE "A$;B$" GORED" 
PRINT FNA(K)" OF THE "A$;B$" KILLED" 
PRINT 
RETURN 

DEF FNA(K)=INT(RND(0)*2)+1 
INPUT A$ 

IF A$="YES" THEN 1990 
IF A$="N0" THEN 2010 

PRINT"INC0RRECT ANSWER, PLEASE PRINT 'YES' OR 'NO'"; 
GOTO 1930 
LET Z 1 = 1 
GOTO 2020 
LET Zl=2 
RETURN 
END 



BULL"; 



60 



SAMPLE RUN 

DO YOU WANT INSTRUCTIONS? YES 

HELLO, ALL YOU BLOODLOVERS AND AFICIONADOS 

HERE IS YOUR BIG CHANCE TO KILL A BULL 

ON EACH PASS OF THE BULL, YOU MAY TRY 

- VERONICA (DANGEROUS INSIDE MOVE OF THE CAPE) 

1 - LESS DANGEROUS OUTSIDE MOVE OF THE CAPE 

2 - ORDINARY SWIRL OF THE CAPE 

INSTEAD OF THE ABOVE, YOU MAY TRY TO KILL THE BULL 
ON ANY TURN: 4 (OVER THE HORNS), 5 (IN THE CHEST) 
BUT IF I WERE YOU, 
I WOULDN'T TRY IT BEFORE THE SEVENTH PASS 

THE CROWD WILL DETERMINE WHAT AWARD YOU DESERVE 

POSTHUMOUSLY IF NECESSARY 

THE BRAVER YOU ARE, THE BETTER THE AWARD YOU RECIEVE 

THE BETTER A JOB THE PICADORES AND TOREADORES DO, 
THE BETTER YOUR CHANCES ARE 



YOU HAVE DRAWN A SUPERB BULL 
GOOD LUCK. YOU'LL NEED IT 



THE PICADORES DID A SUPERB JOB 
THE TOREADORES DID A SUPERB JOB 



PASS NUMBER 1 

THE BULL IS CHARGING AT YOU! YOU ARE THE MATADOR- 
DO YOU WANT TO KILL THE BULL? NO 
WHAT MOVE DO YOU MAKE WITH THE CAPE? 
THE 3ULL HAS GORED YOU 
YOU ARE DEAD 



THE CROWD AWARDS YOU ONE EAR OF THE BULL 
ADIOS 

READY 

RUN 

DO YOU WANT INSTRUCTIONS? NO 

YOU HAVE DRAWN A POOR BULL 

THE PICADORES DID A POOR JOB 

ONE OF THE HORSES OF THE PICADORES WAS GORED 

ONE OF THE PICADORES WAS KILLED 

THE TOREADORES DID A POOR JOB 
NO TOREADORES WERE KILLED 



PASS NUMBER 1 

THE BULL IS CHARGING AT YOU! YOU ARE THE MATADOR- 
DO YOU WANT TO KILL THE BULL? NO 
WHAT MOVE DO YOU MAKE WITH THE CAPE? 2 

PASS NUMBER 2 

THE BULL IS CHARGING AT YOU! YOU ARE THE MATADOR-- 

DO YOU WANT TO KILL THE BULL? NO 

WHAT MOVE DO YOU MAKE WITH THE CAPE? 2 

PASS NUM3ER 3 

HERE COMES THE BULL! TRY FOR A KILL? NO 

CAPE MOVE? 1 

PASS NUMBER A 

HERE COMES THE BULL! TRY FOR A KILL? NO 

CAPE MOVE? 

PASS NUM3ER 5 

HERE COMES THE BULL! TRY FOR A KILL? NO 

CAPE MOVE? 1 

PASS NUMBER 6 

HERE COMES THE BULL! TRY FOR A KILL? NO 

CAPE MOVE? 

PASS NUMBER 7 

HERE COMES THE BULL! TRY FOR A KILL? NO 

CAPE MOVE? 2 

PASS NUM3ER 8 

HERE COMES THE BULL! TRY FOR A KILL? YES 

IT IS THE MOMENT OF TRUTH. HOW DO YOU TRY TO KILL THE BULL? 4 

THE BULL HAS GORED YOU 

YOU ARE DEAD 



THE CROWD AWARDS YOU ONE EAR OF THE BULL 
ADIOS 

READY 



61 



BUNNY 



PRINTS THE PLAYBOY RABBIT 



UN 
BUN 

BUNNYB 
BUNNYBUN 
UNNYBUNNY 
NNYBUNNYBU 
NYBUNNYBUNN 
YBUNNYBUNNY 
BUNNYBUNNYB 
UNNYBUNNYBU 
NNYBUNNYBUN 
NYBUWNYBUNNY 
YBUNNYBUNNYB 
BUNNYBUNNYBU 
UNNYBUNNYBUN 
NNYBUNNYBUN YBUNNYBUNNYBU 
NXfiUNNYBUNNYBUNNYBUNN Y 
YBUNNYBUNNYBUNNYBUNN 
BUNNYBUNNYBUNNYBU 
NNYBUNNYBUNNY 
NYBUNNYBUN 
YBUMNYBU 
UNNYBUNN YBUNN 
N YBUNN YB UNN YBUNN YB 
UNNYBUNNYBUNN YBUNNYBU 
BUNNYBUNMYBUNNYBUNNYBUN 
NYBUNN YBUNNYBUNNYBUNNYBUNN 
nNYBUNNYBUNNYBUNNYBUNNYBUNNY 
UNNYBUNN UNNYBUNNYBUNNYBUNNY 
BUNNYBUN UNNYBUNNYBUNNYBUNNYB 
YBUNNYBUN UNNYBUNNYBUNNYBUNNYB 
NYBUNNYBUN BUNNYBUNNYBUNNYBUNNYB 
NNYBUNNYBUNNYBUNNYBUNNYBUNN YBUNN YB 
UNNYBUNNYBUNNYBUNNYBUNNYBUNNYBUNNYB 
NNYBUNNYBUNNYBUNNYBUNNYSUNNYBUNNY 
NYBUNNYBUNNYBUNNYBUNNYBUNNYBUNNY 
YBUNNYBUNNYBUNNYBUNNYBUNNYBUNN 
UNNYBUNNYBUNNUBUNNYBUNNYBUNN 
BUNNYBUNNYBUNNYBUNNYBUN Y 
YBUN YBUNNYB NYBU B 

BUNNY NYBUNNYB U 
YBUNN U YBUNNYB N 
NYBUNN NY8UNNY NYBUNN 
NNYBUNNYBUNNYBUNNY UNN 
UNN N Y N YBUN NYBU 
BU NN N Y 1 
NN UNNY 
NNY 
NY 



62 



NNYBUN 
NYBUNNYBUN 
UNNYBUNNYBUN 
NYBUNN YBUNNYBU 
UNNYBUNNYBUNNYB 
YBUNNSBUNNYBUNNY 
NNYBUNNYBUNNYBUNN 
UNNYBUNNYBUNNYBUN 
lUNNYBUNNYBUNNYB 
YBUNNYBUNNYBUNNY 
NYBUNNYBUNNYBUNN 
NNYBUNNYBUNNYBU 
UNNYBUNNYBUNNYB 
BUNNYBUNNYBUNN 



BUZZWD 



BUZZWORD GENERATOR 



Description 



This program is an invaluable aid for preparing speeches and 
briefings about computers and high technology. This buzzword 
generator provides sets of three highly-acceptable words to 
work into your material. Your audience will never know that 
the phrases don't really mean much of anything because they 
sound so great! Full instructions for running are given in 
the program. 

Source 

BUZZWORD was adapted from the GE timesharing program by: 

Tom Kloos 

Oregon Museum of Science and Industry 

Portland/ Oregon 97200 




63 



PROGRAM LISTING 

100 PRINT"THIS COMPUTER DEMONSTRATION IS A NEW AID FOR" 

110 PRINT«PREPARING SPEECHES AND BRIEFINGS, IT'S A BUZZWORD" 

120 PRINT"GENERATQR WHICH PROVIDES YOU WITH A SET OF 3 HIGHLY" 

130 PRINT"ACCEPTABLE WORDS TO WORK INTO YOUR MATERIAL, THE WORDS" 

140 PRINT«DQN'T ACTUALLY MEAN ANYTHING, BUT THEY SOUND GREAT," 

150 PRINT 

160 PRINT"THE PROCEDURES" 

170 PRINT" THINK OF ANY THREE NUMBERS BETWEEN AND 9, ENTER" 

180 PRINT" THEM AFTER THE '?« SEPARATED BY COMMAS, YOUR" 

190 PRINT" BUZZWORD WILL BE PRINTED OUT, TYPING «100» FOR" 

191 PRINT" EACH OF YOUR CHOICES STOPS THIS PROGRAM," 
210 PRINT "WHAT ARE YOUR THREE NUMBERS"? 

220 GOTO260 

230 PRINT 

240 PRINT 

250 PRINT"THREE MORE NUMBERS"; 

260 INPUT N,M,P , 

265 IF N*100 THEN 1290 

270 IF N<0 THEN 1240 

280 IF P<0 THEN 1240 

290 IF M<0 THEN 1240 

300 IF N>9 THEN 1240 

310 IF P>9 THEN 1240 

320 IF M>9 THEN 1240 

330 PRINT 

340 IF N«0 THEN 640 

350 IF N*1THEN 660 

360 IF N«2THEN 660 

370 IF N«3THEN 700 

380 IF N«4 THEN 720 

390 IF N«5THEN 740 

400 IF N»6THEN 760 

410 IF N«7THEN 780 

420 IF N">8TMEN 800 

430 IF N89THEN 820 

440 IF M*0 THEN 840 

450 IF M«l THEN 860 

460 IF M«2 THEN 880 

470 IF M«3 THEN 900 

480 IF M»4 THEN 920 

490 IF M«5 THEN 940 

500 IF M«6 THEN 960 

510 IF M*7 THEN 980 

520 IF M»8 THEN 1000 

530 IF M«9 THEN 1020 

540 IF P«0 THEN 1040 

550 IF P = l THEN 1060 

560 IF P«2 THEN 1080 

570 IF P*3 THEN 1100 

580 IFP*4 THEN 1120 

590 IF P»5 THEN 1140 

600 IF P««6 THEN 1160 

610 IF P*7 THEN 1180 

620 IF P"8 THEN 1200 

630 IF P*9 THEN 1220 

640 PRINT" INTEGRATED"; 

650 GOTO440 

660 PRINT" TOTAL"? 

670 GOTO440 

680 PRINT "SYSTEMATIZED"! 

690 GOTO440 

700 PRINT" PARALLEL"? 

710 GO TO 440 

720 PRINT" FUNCTIONAL"? 

730 GOTQ440 

740 PRINT" RESPONSIVE"? 

750 GOTO440 

760 PRINT" OPTIMAL"? 

770 GOTO440 

780 PRINT" SYNCHRONIZED"? 

790 GOTO440 

800 PRINT « COMPATIBLE"? 

810 GOTO440 

820 PRINT" BALANCED"; 

830 GOTO440 

840 PRINT" MANAGEMENT"? 

850 GOTO 540 

860 PRINT" ORGANIZATIONAL"? 

870 GOTO 540 

880 PRINT" MONITORED"; 

890 GOTO 540 

900 PRINT" RECIPROCAL"? 

910 GOTO 540 

920 PRINT" DIGITAL"? 

930 GOTO 540 

940 PRINT" LOGISTICAL"? 

950 GOTO 540 

960 PRINT " TRANSITIONAL"? 

970 GOTO 540 

980 PRINT" INCREMENTAL"? 

990 GOTO 540 

1000 PRINT" THIRD-GENERATION"? 

1010 GO TO 540 

1020 PRINT" POLICY"? 

1030 GOTO 540 

1040 PRINT" OPTIONS" 

1050 GOTO 230 

1060 PRINT " FLEXIBILITY" 

1070 GO TO 230 

108£ PRINT" CAPABILITY" 

1090 GOTO230 

1100 PRINT" MOBILITY" 

1110 GOTO230 

1120 PRINT" PROGRAMMING" 

1130 GO TO 230 

1140 PRINT" CONCEPT" 

1150 GOTO230 

1160 PRINT" TIME-PHASE" 

1170 GOTO230 

1180 PRINT" PROJECTION" 

1190 GOTO230 

1200 PRINT" HARDWARE" 

1210 GOTO230 

1220 PRINT" CONTINGENCY" 

1230 GOTO230 

1240 PRINT 

1250 PRINT 

1260 PRINT«NUMBERS MUST BE BETWEEN AND 9, PLEASE SELECT THREE MORE," 

1270 GOTO 260 

1280 GOTO 260 

1290 PRINT "GOODBYE FOR NOWJ » 

1300 PRINT\PRINT\PRINT 

1310 CHAIN "DEMON " r A 

1320 END D4 



SAMPLE RUN 

BUZZWD EDUSYSTEM-35 

THIS COMPUTER DEMONSTRATION IS A NEW AID FOR 
PREPARING SPEECHES AND BRIEFINGS. IT'S A BUZZWORD 
GENERATOR WHICH PROVIDES YOU WITH A SET OF 3 HIGHLY 
ACCEPTABLE WORDS TO WORK INTO YOUR MATERIAL. THE WORDS 
DON'T ACTUALLY MEAN ANYTHING* BUT THEY SOUND GREAT. 

THE PROCEDURE: 

THINK OF ANY THREE NUMBERS BETWEEN AND 9. ENTER 
THEM AFTER THE '? ' SEPARATED BY COMMAS. YOUR 
BUZZWORD WILL BE PRINTED OUT. TYPING M00' FOR 
EACH OF YOUR CHOICES STOPS THIS PROGRAM. 

WHAT ARE YOUR THREE NUMBERS? 1 , 2, 3 

TOTAL MONITORED MOBILITY 



THREE MORE NUMBERS? 2, 3,4 
SYSTEMATIZED RECIPROCAL PROGRAMMING 

THREE MORE NUMBERS? 0, 0, 
INTEGRATED MANAGEMENT OPTIONS 

THREE MORE NUMBERS? 9, 8, 7 
BALANCED THIRD-GENERATION PROJECTION 

THREE MORE NUMBERS? 7* 8* 9 
SYNCHRONIZED THIRD-GENERATION CONTINGENCY 

THREE MORE NUMBERS?5, 3, 8 
RESPONSIVE RECIPROCAL HARDWARE 

THREE MORE NUMBERS? 2, 6,4 
SYSTEMATIZED TRANSITIONAL PROGRAMMING 

THREE MORE NUMBGRS? 3,4, 5 
PARALLEL DIGITAL CONCEPT 



THREE MORE NUMBERS? 1 00, 1 001-, 100 
GOODBYE FOR NOW! 



CALNDR 



PERPETUAL CALENDAR 



Description 

This program prints out a calendar for any year. You must 
specify the starting day of the week of the year in Statement 
130. (Sunday (0), Monday (-1), Tuesday (-2), etc.). You can 
determine this by using the program WEKDAY. You must also 
make two changes for leap years in Statements 360 and 620. 
The program listing describes the necessary changes. Running 
the program produces a nice 12-month calendar. 

Program Author 

Geoffrey Chase, OSB 
Portsmouth Abbey School 
Portsmouth, RI 02871 




65 



PROGRAM LISTING 



SAMPLE RUN 



100 
110 
120 
130 
140 
150 
160 
170 
180, 
190 
200 
210 
220 
230 
240 
250 
260 
270 
280 
290 
300 
310 
320 
330 
340 
350 
360 
370 
380 
390 
400 
410 
420 
430 
440 
450 
460 
470 
480 
490 
500 
510 
520 
530 
540 
550 
560 
570 
580 
590 



REM: VALUES FOR 1973; SEE NOTES 



=1 TO 6\ PRINT CHR$C10)J 
• 1973 STARTS ON MON. 



FOR I 

D=-l 

S=0 

REM J READ DAYS OF EACH MONTH 

FOR N=0 TO 12 \ READ M(N) \ NEXT N 



V NEXT I 

C0=SUN.,-1=MON.,-2=TUE. 



FOR N=l TO 12 

print \ print \ s=s+m<n-1) 

print m **";s;tab<7>; 

for 1=1 to 18 \ print "*"; \ next i 

ON N GOTO 230, 240, 250, 260., 270, 280*290, 300, 31 0, 320, 330, 340 



PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 



JANUARY 



\GOTO 350 



FEBRUARY'S* \GOTO 350 



MARCH 
' APRIL " 

MAY 

JUNE " 

JULY " 
' AUGUST " 
"SEPTEMBER" 
' OCTOBER " 
' NOVEMBER" 
' DECEMBER"; 

PRINT 



\GOTO 350 
\GOTO 350 
\GOTO 350 
\GOTO 350 
\G0TO 350 
\GOTO 350 
\GOTO 350 
\GOTO 350 
\GOT0 350 



FOR 1=1 TO 18 \ 
PRINT 365-S;"**' 

C366-S; 
PRINT CHRSC 10) 
PRINT " T 
PRINT 
FOR 1=1 TO 59 \ PRINT 

FOR V=l TO 6 
PRINT CHRSC 10) 
PRINT TABC4); 

FOR G=l TO 7 

D=D+ 1 

D2=D-S 

IF D2>M<N) THEN 580 

IF D2>0 THEN PRINT D2; 

PRINT TAB(4+8*G); 

NEXT G 

IF D2=M(N) THEN 590 
NEXT W 

D=D-G 
NEXT N 



ON LEAP YEARS3 
PRINT " S 

F S 



610 FOR I=1T0 6\ PRINT CHRSC 1 0>;\ NEXT I 
620 DATA 0,31,28,31,30,31,30,31,31,30,31,30,31 
630 • C0,31,29, ..., ON LEAP YEARS3 

640 END 

REM: IF YOU HAVE NO CHRSC), SUBSTITUTE "PRINT" FOR "PRINT CHRSC 10);" 
REM: AND "PRINT \ PRINT" FOR "PRINT CHRSC 1 0)'\C WITHOUT SEMICOLON). 



** ft ****************** januaRT ****************** 365** 

. S M T W : T F S ■■: 

*********************************************************** 





1 


2 


3 


4 


5 


7 


3 


9 


10 


11 


12 


14 


15 


16 


17 


18 


19 


21 


22 


23 


24 


25 


26 


28 


29 


30 


31 







** 31 ****************** FEBRUARY****************** 334 ** 

S M T W T F S 

*********************************************************** 



11 


12 


18 


19 


25 


26 





1 


2 


3 


7 


8 


9 


10 


14 


15 


16 


17 


21 


22 


23 


24 



27 28 

** 59 ****************** MARCH ****************** 306 ** 

S M T W T F S 

*********************************************************** 



4 


5 


6 


11 


12 


13 


18 


19 


20 


25 


26 


27 



1 


2 


3 


8 


9 


10 


15 


16 


17 


22 


23 


24 



30 



31 



** 90 ****************** APRIL ****************** 275** 

S M T W T F S 

*********************************************************** 



1 


2 


3 


4 


5 


6 


7 


8 


9 


10 


11 


12 


13 


14 


15 


16 


17 


13 


19 


20 


21 


22 


23 


24 


25 


26 


27 


28 


29 


30 













** 120 ****************** 
S M T 



****************** 245 ** 
T F S 



*********************************************************** 

12 3 4 5 

.>■■■>-■■'- if"'-"''.). 7- : '-'-:."-. 8 .. ; . 9 

'- STOP" ' . 



66 



CAN-AM 



CANADIAN-AMERICAN AUTO RACE 



Description 



CAN-AM is a simulation of a Canadian -American Challenge Cup auto 
race. The road course is fast (speeds up to 200 m.p.h.). It is 
long (5.3 miles) and complex (8 curves and 8 straights). You are 
racing the latest Group 7 cars (McLarens, Lolas, etc.). 

The instructions provided by the program are self -explanatory. 
You should really take heed of track hazards — i.e., rain and oil, 
except, of course, slowing down too much puts you out of con- 
tention. BEWARE: This game is very challenging and addictive I 

Computer Limitations 

The program was written for the Honeywell/GE 635 at Dartmouth. 
The main inconsistency with other computers is that several 
people may race using multiple terminals; this is generally 
not possible on smaller machines. 

The comments on the listing are extremely comprehensive and 
entertaining. We apologize for not having a sample run, but 
it got wiped out. 

Program Author 

Mark Manasse 
Hanover, NH 03755 








U.° 



67 



PROGRAM LISTING 

100 * CAN-AM*** (BASIC PROGRAM BEGINS AT LINE 610) WAS PROGRAMMED BY MARK 

110 ' MANASSE, TO REPLACE THE AILING VERSION HE WROTE AS A SIXTH GRADER 

120 •' AT HANOVER ELEMENTARY SCHOOL. 

130 • LAST CHANGE 12/27/72 BY DIANE MATHER, KIEWIT 

140 • 

150 ' DESCRIPTION — THE PROGRAM ALLOWS YOU TO RACE AROUND A HIGHLY 

160 ' PERILOUS COURSE, RISKING BOTH LIFE AND MACHINE, IN AN 

170 ' EFFORT TO RACE FRIENDS OR THE COMPUTER'S VERY OWN SLOW- 

180 ' POKE SfiM, WILDMAN WILLY, AND HOTSHOT HARRY 

19 ' 

200 ' INSTRUCTIONS — 

210 ' YOU ARE ABOUT TO RACE. RACE ON ONE OF THE FASTEST COURSES 

220 ' IN THE WORLD. A ROAD COURSE. A LONG ONE. 5.3 MILES. SPEEDS 

230 ' UP TO 200 MPH. YOU CAN RACE FRIENDS(?) OR THE COMPUTER. 

240 * TO RACE THE COMPUTER, TYPE THE SEQUENCE: 

250 ' 

250 * /OLD CAN-AM***/RUN 

270 ' 

280 • TO RACE FRIENDS, TYPE: 

2S0 ' 

300 * /OLD CAN-AM***/LINK <KEYWORD>,N 

310 ' 

320 ' REPLACE <KEYWORD> WITH ANY WORD OF LENGTH 1 THROUGH 8 INCLUSIVE 

330 * THfiT YOU CHOOSE. REPLACE N WITH THE NUMBER OF PLAYERS COUNTING 

340 ' YOURSELF. HAVE YOUR FRIENDS TYPE: 

350 • 

350 • JOIN <KEYWORD> 

370 ' 

330 ' <KEYW0RO> SHOULD BE THE KEYWORD YOU USED IN THE 'LINK' COMMAND 

350 » 

400 • WHEN THE COMPUTER TYPES A QUESTION OF THE FORM 

410 ' STRAIGHT A? OR CURVE 1: 

420 * RESPOND BY TYPING THE SPEED (IN MPH) YOU DESIRE TO TRAVEL AT, 

430 » AND HIT THE RETURN KEY. GOOD LUCK. YOU MAY NEED IT. 

440 ' 

450 ' IF YOU ARE USING R TERMINAL WITH BOTH UPPER AND LOWERCASE, TYPE 

450 'WORD ANSWERS (SUCK AS YES OR NO) IM CAPITAL LETTERS. 

470 ' 

430 * TO STOP THIS LISTING, PRESS THE ' S' OR 'ATTN' KEY. 

490 * 

500 ' FOE MORE INFORMATION ON MULTIPLE-TERMINAL PROGRAMMING, (A§ 

510 ' WHEN SEVERAL PEOPLE RACE EACH OTHER), SEE TM009 WHICH IS 

520 * AVAILABLE FROM THE KIEWIT DOCUMENT CENTER (SECRETARIAL AREA), 

530 ' KIEWIT COMPUTATION CENTER, HANOVER, N. H. 03755, PHONE 

540 ' (603) 645-2643. 

550 • 

550 ' EXPLANATION OF CHANGES — 

570 ' 12/27/7 2 — TO REWORD INSTRUCTIONS. 

53 ' 

590'-** ************* ******* 

63 3 

610 HEM PLEASE REFER ALL BUGS OR COMMENTS TO DIANE 

620 REM MATHER, PROGRAM LIBRARIAN, 105 KIEWIT 

63 

640 LET 0(0)=2 'STANDARD MOTIF HEADER 

650 LET 0(1) = ASC(SOH) 

650 LET 0(2) = ASC(N) 

670 CHANGE TO 01$ 

680 LET 0(2)' = ASC(Q) 

690 CHANGE TO 0$ 

700 PRINT Ol$;0$;CHR$(13) ;"XX ARE YOU FAMILIAR WITH THE WAY THIS GAME WORKS'"; 

710 LATA NON,OUI,PARLEZ-VOUS ANGLAIS ?, NEIN ,JA, SPRECHEN SIE ENGLISCH? 

720 LATA NOPE, YUF, COMPUTERS ARE SOPHISTICATED MACHINES. USE APPROPRIATE LANGUAGE. 

730 LET K9=5 'TWICE NUMBER OF KNOWN LANGUAGES 

740 FOR X=l TO K9-1 STEP 2 

750 READ F$(X),F$(X+l),R$((X-l)/2 + l) 

760 NEXT X 

770 REM WE HAVE JUST LERRNED FOREIGN LANGUAGES 

730 DATA WILDMAN WILLY, HOTSHOT HARRY, SLOWPOKE SAM 'NAMES OF DRIVERS WHO COMPETE AGAIN 'iT ONLY ONE PERSON. (AUTO-PILOTS) 

790 i v AT RFAD Q$(3) 'NAME ARRAY 

800 DATA -2.9,-2.9,-5 'AMT. SPEED TO BE SUBTRACTED FROM AUTO-PILOT* SPEEDS 

810 f.AT READ Q(3 ) 

820 YPT READ M$(3) 'READ NAKES OF TYPES OF ROADWAY 

330 READ X$ 'DEATH MESSAGE 

840 INPUT A$ 'RESPONSE TO DO YOU KNOW WHAT YOU'RE DOING? 

850 IF A$>"39" THEN 890 'IF BETWEEN 01 AND 09, THEN MULTI-TERMINAL 

860 IF A$<"01" THEN 890 

870 LET 09 = fAL(A?) 

880 COTC 960 

890 LET 0$="" 'SET THINGS UP FOR SINGLE TERMINAL 

900 GOSUB 2190 

910 IF A$="NO" THEN 1070 

920 FRINI "RATE YOURSELF AS A DRIVER. ( 1-BEST ,3-WORST )" ; 

930 INPUT 

940 Lit Q(3)=Q(3)*0 

950 GOTO 1050 

950 LET 0(2) = ASC(A) 'CREATE 0$ ARRAY FOR MULTI-TERMINAL 

S70 CHANGE TO 0$(10) 'STANDARD MOTIF 

930 FDR I =0 TO 09 

9S0 LET 0(2) = ASCCO + I 

1300 CHANGE TO 0$(I) 

1010 NEXT I 

1320 PRINT 0$(10); ,, YOU MAY 'DRAFT' (SLIPSTREAM) OFF-OF ANY. CAR AHEAD" 

1030 PRINT "OF YOU. ( BUT NOT MORE THAN 1 SECOND AHEAD). TO DO THIS" 

1340 PRINT "TYPE HIS CAR NUMBER+1000 AS YOUR SPEED." 

1050 RANDOMIZE 

1350 IF A$="YES" THEN 1110 

1070 PRINT 0$(0) 

1080 PRINT "FOR INSTRUCTIONS, PLEASE TYPE LIST AFTER THE COMPUTER SAYS READY." 

1090 PRINT 

1L 00 IF A$="NO" THEN 2290 

1110 LET F2=lNT(RND*10)+6 

1120 FOR A=0 TO 09 'ASSIGN NUMBERS AND ADHESION FACTORS 

1130 PRINT 0$(A);"YOUR DRIVING NUM3ER IS" ;F2*( A+l )+A 'ADHESION FACTOR IS HOW WEL YOUR CAR GRIPS THE ROAD 

1140 LET A(R)=RND*.05+.05 

1150 PRINT 0$(A);"RBHESION FACTOR"; A( A)*100-5; " . (THE LOWER THE BETTER)" 

1150 ^EXT A 

1170 PRINT 0$(10);"YOUR MAX. SPEED IS 20C MPH. TO SEE STANDINGS INPUT" 

1180 PRINT "0 AS YOUR SPEED" 

1190 PRINT 3$(0);"WOULD *0U LIKE TO SEE THE COURSE" ; CHR$( 63*SGN( 09 )); 0$; 'PRINT ? IF ULT-TERM, OTHERWISE DON'T 

1200 MAT INPUT AS 

1210 FRINT 0$(10 ); 

1220 LET A$ = A$(NiJM) 

1230 GOSIR 2190 

1240 IF AS="NO" THEN 1450 ^^ 

68 



1250 IF A$<>"YES" THEN 1190 

1250 Pi?IMriftB(4 ); " "' 'PRINT COURSE 

1270 FRINTTRB(3) ;"/l"rTRB(ll);"B";TAE(19);"2\" 

1280 PRINTTRB(2)- , 7R";TRB(20); ,, C\" 

1290 FRINTTRB(l) ;"/";TRB(22); ,, \ ,, 

1300 PRINT "/ ,, ;TAB(21);"3I" 

1310 PRINT "a-STRRT*FINISH";TAB(22);"I m 

1320 PRINT "a-.-TAB^);"!" 

1330 FRINT "a";TJIB(21);"EI" 

1340 PRINT "a";TRB{22);"I h 

1350 FRINT ,, a";TSB(22);"I" 

1360 PRINT "aH";TAB(22);"I" 

13 7 3 RINI "a»;TRB(22);"I" 

1380 PRINT ,, a";TSB(21) ;"4I" 

13 90 PRINT "a"; TAB (16);" _ /" 
1400 FRINT"a8";TRB(15);"T5~E"" 
1410 PRINT "a";TRB(15);"\" 

1420 PRINT n \";TAB(17);" ) ";CHR$ (13) ;TBB(20) ;"/PITS\" 

1430 FRINT " \7" ;TRB(14);"G ,, ;TRB(21);"FA";TRB(27); ,, 6I ,, 

1440 PRI^T" \ /" 

14 50 LET N=RND*3+1 
1450 5 RINT" 

MOTE: THIS IS A"; INI ( N) ; "LRP RACE." 

1470 PRINT" 

GENTLEMEN, START YOUR ENGINES! THE GREEN GOES DOWN AND" 

1480 FRINT"0FF YOU GO!" 

1490 DATA STRAIGHT, HAIRPIN, CURVE 

1500 DATA MAY I SHOW YOU TO A PLOT? WE HAVE A NICE CHOICE OF HEADSTONES. 

1510 LET 0=-l 

1520 LET H = LNT(N) 

1530 FOR V=l TO N 'WORKING PORTION 

1540 LET Y=FNA(M$(1), 230, 1,3/10, 65) 'STRAIGHT R, 200 MAX., 3/10 KILE LONG 
1550 LET Y=FNA(M$(3), 125, 1,1/10, 49) 'CURVE 1, 125 MAX., 1/10 MILE LONG 
1550 LET Y=FNA(M$(1),20Q,2,13/2Q,65) 'STRAIGHT 3, 200 MAX., 13/20 MILE LONG 
1570 LET Y=FNA(M$<3), 125, 1,1/10, 50) 'CURVE 2, 125 MAX., 1/10 NILE LONG 
1580 LET Y=FNR(M$(1), 200, 1,1/5, 67) 'STRAIGHT C, 200 MAX., 1/5 MILE LONG 
1590 LET Y=FNA(M$( 3), 150,1,3/20,51) 'CURVE 3, 150 MRX., 3/20 MILE LONG 
1600 LET Y=FNA(M$(l),200,2,3/5,68) 'STRAIGHT D, 200 MR*,, 3/5 MILE LONG 
•1610 LET Y=FNA(M$(3), 125, 1,1/10,52) 'CURVE 4, 125 MAX., 1/10 MILE LONG 
1520 LET Y=FNA(M$( 1), 230,1,1/4, 69) 'STRAIGHT E, 200 MRX., 1/4 MILE LONG 
1630 LET Y=FNA(M$(2), 100, .75, 3/20,53) 'HAIRFIN 5, 100 MPX., 3/20 MILE LONG 
1643 LET Y=FNA(M$( 1) , 200, 1 . 5,9/20 , 70 ) 'STRAIGHT F, 200 MRX., 9/20 MILE LONG 
1550 LET Y=FNA(M$( 2) , 100, . 75, 3/20, 54 ) 'HAIRPIN 5, 100 MRX., 3/20 MILE LONG 
1660 LET Y=FNfl(M$(l),200,2,l,71) 'STRAIGHT G, 200 MRX., 1 MILE LONG 
1570 LET Y=FNA(M$( 3), 125, 1,1/10,55) 'CURVE 7, 125 MAX., 1/10 MILE LONG 
1680 LET Y=FNA(M$(3),150,l,3/20,56) 'CURVE 8, 150 MRX., 3/20 MILE LONG 
1690 LET Y=FNA(M$(1),200,2,7/10,72) 'STRRIGHT H, 20C MRX., 7/10 MILE LONG 
1700 IF V = H THEN 1740 - ■' 

1710 LET Y=FNA("START-FINISH (CURVE 9 ) " , 150 ,1 , 3/20 , 127) 
17 2 REM NRME OF TRACK ,MAX,4,LEN ,RSC 

1730 REM START-FINISH, 150 MAX., 3/20 MILE LONG 

1740 NEXT V 

1750 IF Gl=l THEN 2040 ' RLL DERD? 

1760 PRINT O$(10);"DO YOU MEAN THAT EVERYONE ISN'T DERD? WELL, HERE ARE " 'NO, SO PRINT OUT RESULTS OF RRCE 

1770 PRINT'THE RESULTS STRAIGHT FROM THE CHECKERED FLRG: 

178 LET W=lE+3 7 

1790 IF 89=0 THEN 1820 

1300 LET G5=09 

1810 GOTO 183 

1820 ,ET G5=3 

1830 FOR Z=G TO G5 

1340 IF 09>Q THEN 1380 

1850 IF Z=0 THEN 1880 

1850 PRIST 2$(Z); 

1670 GOTO 1890 

1330 PRIST"GUY tf";F2*(Z+l)+Z; 

1890 IF D(Z ) = THEN 1950 

1900 PRINT" IS LOOKIN' RT THEM PEARL* GATES." 

1310 IF 09=0 THEN 1990 

1920 PRINT 0$(Z);"TELL ST. LUCIFER NOT TO EXPECT ME, O.K.?" 

193 PRINT 3$(10); 

1940 GOTO 1990 

1S5C PRINT" TOOK";T(Z);"SECONDS. WHICH AVERRGES OUT TO ";36 00*5. 3*H/T ( Z ) ;"MPH" 'T RRRRY IS TIME ARRAY 

I960 IF T(Z)>W THEN 1990 

13 7 LET W=I(Z) 'NEW LERDING TIME RND DRIVER 

1980 LET N=F2*(Z+1)+Z 

1990 *EXT Z 

2003 IF 93>0 THEN 2020 

2010 IF N>F2 THEN 2040 

2020 PRINT OS((N-F2)/(F2+l))?"NICE RACE, MR";N 

2030 PRINT 0$(10);"AND THAT MEANS THAT GUY #";N; "WINS! ! ! " 

2340 PRINT 0$(0);"RN0THER RACE" ;CHR$( 63*SGN (09 ) ) ; 0$; 

2050 J' AT INPUT R$ 

2063 LET A$=A$(N'JM) 

2070 GOSUB 2190 

2380 IF A$ = "NO" THEN 2290 

2G90 IF A$<>"YES" THEN 2040 

2100 FOR 2=0 TO 10 'RESET FOR NEXT GRME 

2110 LET T( 2)=D(Z)=C 

2120 SEXT Z . 

2130 PRINT 0$(10);"NE» SET-UP. NO RRIN, NO DEBRIS",* 

2143 IF G1=0 THEN 2160 'IF EVERYBODY'S DERD, BE NRSTY. 

2150 PRINT ", RNE (PLERSE!) BETTER DRIVERS." 

2150 PRINT 

2170 LET G1=F5=0 'UNKILL EVERYBODY RND UNCIL THE TRRCK 

2130 G3TO 1110 

2190 FOR X=l TO K5 'FOREIGN LRNGURGE HANDLER 

2200 IF R$=F$(X) THEN 2230 

2210 NEXT X 

2223 GOTO 2280 

2230 PRINT 0$(0);R$((X-1)/2*1) 

2240 IF X=INT(X/2)*2 THEN 2270 

2250 LET R$="NO" 

2260 C-OTC 2280 

2273 LET A$="YES" 

2280 RETURN 

2290 STOP 



69 



CONTROL FUNCTION 

2300 ' 

2310 DEF FNA(A$,R,B,C,D) 'KIND TRACK, MAX. SPEED, ADHESION FUDGE FACTOR, LENGTH 

2320 •ASC(LETTER FOLLOWING KIND OF TRACK) 

2330 IF Gl«l THEN 4250 'ALL DEAE? 

2340 G0SU3 2800 'GET SOME HAZARDS (IE RAIN, OIL) 

2350 COSUB 3220 'GET EVERYONE'S SPEED 

2360 FOR G=0 TO 09 'CHECK FOR SAFE SPEEDS 

2370 IF D(G) = 1 THEN 2780 

2380 IF (B+A(G)+E)*S(G)/B<=R*(l+RND*.l) THEN 2500 
2390 PRINT C$(G);X$ 'PRINT DEAD MESSAGE 

2400 LET F5=F5+1 'INCREMENT OIL C3UNIER 

2410 LET E(F5)=D 'AND THE 635 SAID "LET THERE BE OIL." AND THERE IT WAS. 

2420 FOR Z=0 TO 09 'AND THE TRACK ABOUNDED WITH OIL. AND THE 635 SAID "BOY, WHAT 

2430 IF Z=G THEN 2450 'A MAN TRAP!" 

2440 PRINT 0$(Z);"GUY #" ; F2* ( G+l ) + G; " JUST WIPED REAL GOOD ('N DEAD!)" 'IN THE MEANTIME, IT HAS BEEN BUSY NOTIFYING PEOPLE 

2450 NEXT Z 'OF THEIR COMRADE' S. DEMISE. 

2460 LET D(G)=1 'OFFICIALLY PRONOUNCE DEAD. D IS'FOR DEATH 

2470 LET Q=Q+1 'INCREMENT DEAD COUNTER 

2480 IF Q=09 THEN 4230 'EVERYBODY DEAD? 

2490 GOTO 2780 

2500 LET Y4=T(G) 'RATS. HE DIDN'T WIPE 

2510 IF (3«-A(G)+E)*S(G)/B< = R THEN 2530 

252C PRINT 0$(G) .'"NEARLY HAD TO SAY GOOD BYE." 'ALMOST WIPED 
2530 LET T(G)=T(G)+C/(S(G)/3600)+L(G) 'UPDATE HIS TIME 

2540 IF 09>0 THEN 2660 'SEE IF, HEAVEN FORBID, HE PASSED SOMEBODY 

2550 FOR X4=l TO 3 . 
2550 IF D(X4)=1 THEN 2650 

2570 LET Z4 = T(X4)-(C/(S(X4)/3600)) 

2580 LET Z1=Y4-Z4 

2590 LET Z2=T(G)-T(X4) 

.2600 IF SGN(Z2)<>-SGN(Z1) THEN 2650 

2610 IF SGN(Z2)=1 THEN 2640 

2S20 PRINT "YOU JUST PASSED ";Q$(X4) 

2630 GOTO 2650 

2640 PRINT Q$(X4);" JUST PASSED YOU" 

2550 NEXT X4 
2660 FOR X4=G+1 TO G9 
2570 IF D(X4)=1 THEN 2770 

2580 IF S(X4)=0 THEM 2770 

2690 IF SGN(Y4-T(X4))=SGN(I(G)-(T(X4)+C/(S(X4)/3600))) THEN 2770 

2700 IF SGN(T(G)-(T(X4) + C/(S(X4)/3600)))o-l THEN 2740 

2710 PRINT 0$(X4);"GUY";F2*(G+1)+G;"JU3T PASSED YOJ." 

2720 PRINr O$(G);"Y0U J'JST PASSED GUY"; F2*-( X4+1 )+X4 

2730 GOTO 2770 

2740 IF SGN(T(G)-(T(X4HC/(S(X4)/3600)))=0 THEN 2770 

2750 PRINT 0$(G);"GUY";F2*(X4+1)+X4;"JUST PASSED YOU." 

2760 PRINT 0$(X4);"Y0U JUST PASSED GUY "; F2*( G+l )+G 

2770 NEXT X4 

2780 NEXT G 'PROCEED TO THE FATE OF THE NEXT VICTIM 

2790 GOTO 4250 'NO MORE VICTIMS. (THIS TIME!!) 

29 00 REM HAZARDS 

2 810 FRINT 0$U0); ■ . 

2320 jiET E = MAKE SURE WE DOY'T USE LAST SECTION'S OIL ON THIS SECTION 

2830 ^AT L=ZER 'KILL PIT STOPS FROM LAST TIME 

2 840 LET L(0) = 

2850 IF F5<2 THEN 2900 'IF COURSE WELL GREASED, DISSOLVE GREASE 

2850 PRINT "THE RED FLAG HAS BEEN PUT OUT. CARS REMAIN" 
2870 FRINT "MOTIONLESS UNTIL DEBRIS IS CLEARED" 
2330 1RT E=ZER 
2390 LET F5=0 

2900 FOR X=l TO F5 'SEE IF THOSE FLAYING DESERVE OIL 

2910 IF E(X)=D THEN 2940 
2 920 NEXT X 
2930 GOTO 2970 

2 940 PRIM"YIKES! OIL ON THE TRACK!" 'IF SO, NOTIFY SURVIVORS AND OTHERS 
2950 LET E = .2 

2960 GOTO 3130 

2370 IF F3=l THEN 3130 'HAVE WE HAD RAIN? 

2380 IF RND>.025+G8 THEN 3130 'SEE IF IT SHOULD BE STOPPED OR STARTED 

2990 IF fitOK.l THEN 3080 'IS IT RAINING? 

3000 IF RN'D>.5 THEN 3130 'STOP IT? 

3010 FRINT "GLORY BE, THE RAIN HAS STOPPED! BUT REMEMBER IT IS STILL WET" 

3020 LET F3=l 'RAIN, RAIN, GO AWAY, WON'T COME BACK ANOTHER DAY 

303 FOR A=0 TU J 9 

3040 LET A(A) = A(A)-.075 'DELETE MOST OF THE EFFECTS 

3050 LET G8=.025 MAKE IT LESS LIKELY TO RAIN IN LATER RACES 

3 060 NEXT A 
3070 GDIO 3130 

3080 PRIM "RAIN! SLOW J.OWN!!" 'HALLELUJAH, MY FAIN DANCE WORKED 

3090 FOR A = TO 09 MAKE TRICK SLIPi'EfY 

3100 LET A( A) = A(AH .1 

3110 LET G8=.l 

3120 NEXT A 

3130 IF C<>9/20 THEN 3210 'PIT STOPS? 

3140 IF RND <. 125 THEN 3210 

3150 FOR X=0 TO 9 

3160 IF RND*SGN(09)<.75 THEN 3200 

3170 IF D(X)=1 THEN 3200 

3180 LET L(X)=RND*3+5 

3190 PRINT 0$(X);"Y0U ARE IN THE PITS FOR" ;L( X); "SECONDS . " 

3200 NEXI X 

3210 RETURN 'WE WUZ HERE (AND LEFT!) 

3220 REM INPUT 

3230 *!AT 5=ZER ' RESET SPEED ARRAY 

3240 IF 03>0 THEN 3270 'PRINT OUT SOMETHING LIKE 'STRAIGHT A' 

3 250 PRINT A$;" ";CHR$(D); 

3260 GOTO 3280 

3270 PRINT 0$(10);A$;" ";CHR$ (D) ;": ";0$; 

3230 LET S(D)=0 'GET EVERYBODY'S SPEEDS 

3290 FOR A = TO 09 

3300 IF D(A)=0 THEN 3330 

3310 PRINT 0$(A) 'IF HE'S DEAD, DON'T GIVE HIM A CHANCE TO INPUT 

3320 PRINT 0$; 

3330 NEXT A 

3340 MAT INPUT J 'INPUT SOMEBODY'S SPEED 

3350 IF NUM=1 THEN 3390 'SOMEBODY TYPED SOMETHING. SET UP SPEED AND TTY# 

3350 LET N=J(1) 

3370 LET S=J(2) 

3380 GOTO 3410 



70 



3390 LET S=Jfl) 

3400 LET N=0 

3410 IF D(N)=0 THEN 3450 'IS THE GUY DEAD? 

3420 PRINT 3>$(N); ,, BUT I THOUGHT YOU WERE DEAD." 'RE-INFORM HIM THAT HE IS AN UN-PERSON 

3430 PRINT 0$; 

344 GOiTO 3 34 

3450 IF S(N)=0 THEN 3480 

3460 PRINT 0$(N) ;"WAIT A SEC. 

3470 GOTO 34 30 

3480 LET A=N 

3490 IF S<=200 THEN 3620 

3500 IF 09=0 THEN 3600 

3510 IF S<1000 THEN 3600 

3520 LET R4=(S-1000-F2)/(F2+1) 

3530 IF R4=INT(R4) THEN 3560 

3540 PRINT 0$(N);"ILLEGAL CAR" 

3550 GOTO 3640 

3560 IF R4>09 THEN 3540 

3570 IF E(R4)>0 THEN 3540 

3530 IF J\BS(T{N)-T(R4)~.5)=>.5 

3590 GOTO 3700 



'HAS THIS GUY ALREADY TOLD US HIS SPEED? 
I STILL NEED";09-U-Q;"M0RE SPEEDS." 'TELL HIR TO BUZZ OFF 



"DID HE TRY TO EXCEED HIS MAX. SPEEEv 



•IT'S OK. HE ONLY WANTS TO DRAFT 
•NOW SEE IF HE PICKED A LEGAL CAR 
'HE DIDN'T 



THEN 3540 

'HE DID!! ! 
3600 PRIHT 0$(N);"MAYBE A LITTLE HARE ON THE PEDELE? BE REALISTIC." 'OPTIMIST 
3510 GOTO 3640 
3620 IF S>0 THEN 3660 

•HE WANTS TO SEE HOW HE'S DOING. POOR GUY 
;CHR$(63*SGN(09));0$; 



HE LOKl ISLAND EXPRESSWAY? 



'SINCE HE MADE IT THIS FAR, ASSUME THAT IT' S LEGAL 



3530 G03UB 3990 

3 640 PRINT "HOW FAST" 

3550 GOTO 3340 

3663 IF S = >20 THEN 3690 'WHERE DOES HE THINK HE IS? 

3670 PRINT 0$(N); B I DOUBT YOU WANT TO GO THAT SLOWLY" 

368 IIDTO 3fi40 

35 9 LET S(N)=S 

3 7 00 LET U=IJ+1 

3713 IF R4 = THE?* 3740 - 

3 720 LET H(N)=R4 'IF HE'S DRAFTING, TELL ME TO WHOM 

373 LET R4=0 

3740 IF U<09-Q THEN 3430 'ARE WE EONE? 

37 50 LET U=0 'YES! 

3760 IF CS>0 THEN 3890 'SET SPEEDS FOR AUTO-PILCTS - • 

3770 FOR F0=1 TO 3 



3780 
3790 
3300 
3810 
382 
3 8 30 
3340 
3850 
3360 
31370 
33 BO 
389C 
3 3 03 
3 910 
3 92 
3930 
3910 
3950 
3950 



IF D(FG)=1 THEN 3870 

LET S=R*B/(B+.l + E+G8)-»-(RND*3 + Q<F0)) 

IF (B+.1+G8+E)*S/B<=R THEN 3850 

LET D(F0)=1 

PRINT 0$(10);Q$(F3);" JUST WIPED" 'AND INFORM US IF THEY WIPE 

LET F5=F5+1 

LET E(F5) = D : 

LET T(F0)=T(F0)+C/(S/3600) 

LET 3(F0)=S 
NEXT FO 
SOTO 3 9 « 
FOR X2=0 TO 09 

IF D(X?) = 1 THEN 3970 

IF S(X2)<>0 THEN 3970 

IF S(H(X2.))<>0 THEN 3950 

LET H( X2)=H(H(X2) ) 

GOTO 39 2 

LET S(X2)=S(H(X2)) 

LET TU2) = (T(X2)+I(H(X2)))/2 
3 570 NEXT X2 
3980 RETURN 
3990 REM PLACING 
4003 PRINT 0$(A) 
4010 IF 09=0 THEN 4040 
4020 LET 35=09 
4030 GOTO 4050 
4043 LET 15=3 
4050 FOR G=0 TO G5 

IF G=A THEN 4200 

IF 09>0 THEN 4100 

PRINT Q$(G);" IS"; 

GOTO 4110 

PRINT ,, GUY»",*F2*{G + 1)+G;"IS M ; 

IF D(G)<>1 THEN 4140 

PRINT " OUT OF THE RACE." 

GOTO 4200 

ON SGN(T(A)-T(G))+2 GOTO 4150,4170,4190 'BUSINESS PART 

PRINT T(G)-T(A); H SEC0NDS BEHIND YOU" 'GOOD NEWS 

GOTO 4200 

PRINT " RIGHT BESIDE YOU." SO SO 

GOTO 42 00 

PRINT T(A)-KG) ;"SECONDS AHEAD OF YOU." 'BAD NEWS 
4200 NEXT G 
4210 PRINT" 

YOU'VE TAKEN";T(A);"SECONDS. M 'MORE BAD NEWS 

4220 RETURN 'AND AN ANTI-CLIMACTIC ENDING. (STOLEN FROM SPIEL*** AND SPACEWAR) 

4230 PRINT 0$(10 );"GUY#";F2*(G+1) + G; B , THE LAST OF THE GREAT RACERS, JUST WIPED." 

4240 LET Gl=l 'ALL HUMANS ARE DEAD, SO GRIND THIS MANGLE TO A HALT, AND SET A FLAG TO THAT EFFECT 

4250 FNEND "AND RETURN FROM WHENCE WE CAME 

4250 END 
READY 



4060 
4070 
4380 
4090 
4100 
4110 
4120 
4130 
4140 
4150 
4160 
4170 
4180 
419U 



"NOW HANILE DRAFTERS. 



•SET HIS SPEED TO .HIS DRAFTEES, AND 
'HALVE THE DISTANCE BETWEEN THEM 



•NOW GO COUNT SURVIVORS AND INCREMENT TIMES; 
'TELL ME HOW I'M DOHG 



•I AM RACING AGAI.NST AUTO-PILOTS 
»I AM RACING AGAINST FRIENDSC?) 



•IF COMPETITOR HAS MET HIS MAKER, SAy SO 



71 



CHANGE 



COMPUTER IMITATES CASHIER 



Description 

In this program, the computer pretends it is the cashier at 
your friendly neighborhood candy store. You tell it the cost 
of the item(s) you are buying, the amount of your payment, and 
it will automatically (I) determine your correct change. Aren't 
machines wonderful? 

Program Author 

Dennis Lunder 
People's Computer Co. 
Menlo Park, CA 94025 



2 PRINT "I, YOUR FRIENDLY E0U3Y8TEM COMPUTER, WILL DETERMINE" 

3 PRINT "THE CORRECT CHANGE FOR ITEMS COSTING UP TO $100. » 

4 PRINTVPRINT 

10 PRINT "COST OF ITEM" J SINPUT AVPRINT "AMOUNT OF PAYMENT" JUNPUT P 

20 C«P-A\M»CMF C<>0 THEN 90 SPRINT "CORRECT AMOUNT, THANK YOU" 

30 GO TO 10 

90 IF C»0 THEN 120 SPRINT "SORRY, YOU HAVE SHORT CHANGED M£ $"JA»P 

100 GO TO 10 

120 PRINT "YOUR CHANGE, $" ICSD»INT(C/10) SIF D«0 THEN 155 

150 PRINT DI"TEN OOLLAR BJLL(8) B 

155 C«M*(D*10)SE«INT<C/5)SIF E«0 THEN 185 

180 PRINT E|"FIVE DOLLAR BJUCS)" 

185 C»M-(D*10*E#5)SF«INT(C)SIF F«0 THEN 215 

210 PRINT FMONE DOLLAR BILL(8)" 

215 C«M.(D*10*E*5*F)SC«C*100SN«C\G«INT(C/50}SIF G*0 THEN 255 

250 PRINT GIMONE-HALF DOLLARCS)" 

255 C«N.(G*50)SH»INT(C/25)SIF H«0 THEN 285 

280 PRINT HJ>'QUARTER(S)« 

205 C»N-(G*50*H*25)SI«INT(C/10)SIF I«0 THEN 315 

310 PRINT I.|»DIME<8)" 

315 C»N.(G*60*H*25*I*10)SJ«INT(C/5)SIF J«0 THEN 345 

340 PRINT JJ«NICKELC3)" 

345 C»N-(G*50*H*25*I*10*J*5)SK«INT(C*,5)SIF K«0 THEN 380 

370 PRINT KJ»PENNY(8)M 

380 PRINT "THANK YOU,C0ME AGAIN"SPRINT SPRINT SGO TO 10 

999 END 



I, VOUR FRIENDLV EDUSVSTEM COMPUTER, WILL DETERMINE 
THE CORRECT CHANGE FOR ITEMS COSTING UP TO '$199, 



COST OF ITEM? 4. 59 
AMOUNT OF PAVMENT? 10 
VOUR CHANGE,* 5. 41 

1 FIVE DOLLAR BILL(S) 

1 GUARTERCS) 

1 DIME<S) 

1 NICKEL <S) 

1 PENNV<S> 
THANK VOU, COME AGAIN 



COST OF JTEM? 0. 17 
AMOUNT OF PAVMENT? 5. 6 
VOUR CHANGE, * 4. 83 

4 ONE DOLLAR BILL(S) 

1 ONE-HALF D0LLAR<S) 

1 QUARTERNS) 

1 NICKEL<S) 

3 PENNV<S) 
THANK VOU, COME AGAIN 



COST OF ITEM? 18. 88 
AMOUNT OF PAVMENT? 20 
VOUR CHANGE,* 1. 12 
1 ONE DOLLAR BILL<S) 

1 DIME<S> 

2 PENNV<S) 

THANK VOU, COME AGAIN 




72 



CHECKR 



CHECKERS 



Description 



This program plays checkers. The pieces of the computer are 
marked with an "X", yours are marked "0". A move is made by 
specifying the coordinates of the piece to be moved (X,Y) . 
Home (1,1) is in the bottom left and X specifies distance to 
the right of home (i.e., column) and Y specifies distance 
above home (i.e., row) . You then specify where you wish to 
move to . 

Limitations 

Unfortunately, the computer program is not smart enough to 
recognize (or permitl) a double or triple jump. If you try 
one, it is likely that your piece will disappear altogether. 

Program Author 

Alan J. Segal 

151 Shrubhollow Road 

Roslyn, NY 11576 




© 1 967 by Creative Publications 



73 



PROGRAM LISTING 



100 PRINT" THIS PROGRAM WILL PLAY CHECKERS. THE COMPUTER IS X," 

200 PRINT"AND YOU ARE 0. THE COMPUTER WILL GO FIRST* -NOTE* SQUARES" 

300 PRINT"ARE IN THE F0RM-<X#Y) AND SQ. 1*1 IS THE BOTTOM LEFT!" 

400 PRINT-DO NOT ATTEMPT A DOUBLE JUMP OR YOUR PIECE MIGHT JUST " 

500 PRINT M DISAPPEAR<SAME FOR A TRIPLE!)" 

600 PRINT" WAIT FOR THE COMP. TO MOVE!!!!!" 

700 LET G«-l 

800 DIM R(50) 

900 LET L--1 

1000 DIM SCIO'IO) 

1100 DATA 1»0'1*0*0'0*"1»0'0»1»0»0'0*-1»0>-1'15 

1200 FIR X-1T88 

130C FOR Y-1T08 

140G READ J 

1500 IF J«15 THEN 1800 

1600 LET S<X»Y)«J 

1700 GOTO 2000 

1800 RESTORE 

1900 READ S<X»Y> 

2000 NEXT Y 

2100 NEXT X 

2200 REM 

2300LETL«-1*L 

2400 FOR X-1T08 

2500 FOR Y-1TQ8 

2600 IF S(X»Y>«0 THEN 3500 

2700 IF G>0 THEN 3000 

2800 IF S<X«Y>>0 THEN 3500 

2900 GOTO 3100 

3000 IF S<X>YXO THEN 3500 

3100 IF ABS<SCX*Y)X>1 THEN 3300 

3200 GOSUB 4300 

3300 IF ABS<S<X#Y)X>2 THEN 3500 

3400 GOSUB 6500 

3500IFX<>8 THEN 3800 

3 600IFL«1 THEN 3800 
3700RETURN 
3800NEXT Y 
390ONEXT X 
4000PRINT 
4100G8SUB11400 
4200 GiTO 2300 

4300 FOR A--1T01 STEP 2 
4400 LET U»X+A 
4500 LET V-Y+G 

4 600 IF U<1 THEN 6300 
4700 IF U>8 THEN 6300 
4800 IF V<1 THEN 6300 
4900 IF V>8 THEN 6300 

5000 IF S<U*VX>0 THEN 5300 

5100 GSSUB 9100 

5200 GBT§ 6300 

5300 IF S<U*V)«G THEN 6300 

5400 IF S<U#V)«2*G THEN 6300 

5500 LET U-U+A 

5600 LET V-V+G 

5700 IF U<1 THEN 6300 

5800 IF U>8 THEN 6300 

5900 IF V<1 THEN 6300 

6000 IF V>8 THEN 6300 

6100 IF S(U*VX>0 THEN 6300 

6200 G9SUB 9100 

6300 NEXT A 

6400 RETURN 

6500 REM KING MtVES 

6600 FOR A—1TQ1 STEP 2 

6700 FOR B— 1T01 STEP 2 

6800 LET U-X+A 

6900 LET V=Y*B 

7000 IF U<1 THEN 8700 

7100 IF U>8 THEN 8700 

7200 IF V<1 THEN 8700 

7300 IF V>8 THEN8700 

7400 IF S<U>V><>0 THEN 7700 

7500 GOSUB 9100 

7 600 GOTO 8700 

7700 IF S<U>V)«G THEN 8700 

7800 IF S(U>V)»2*G THEN 8700 

7900 LET U»U+A 

8000 LET V«V+B 

8100 IF U<1 THEN 8700 

8200 IF U>8 THEN 8700 

8300 I F V* 1 THEN 8700 

8400 IF V>8 THEN 8700 

8500 IF S<U»VX>0 THEN 8700 

8 600 GOSUB 9100 
8700 NEXT B 
8800 NEXT A 
8900 RETURN 
9000 GOTO 14200 
9100 REM 

9200 LET P«P+I 

9300 IF P«K THEN 12300 

9400IF V«><4.5+<3.5*G>> THEN 9600 

9500 LET O-Q+2 

9600 IF X<X4.5-<3.5*G>> THEN 9800 

9700LET G«Q-2 

9800 REM 

9900 IF U<>1 THEN 10100 

10000 LET Q»Q+l 

1 0100 IF U<>8 THEN 10300 

10200 LET Q«Q>1 

10300 FIR C--1T01 STEP 2 

10400 IF S<U+C*V*GX1 THENJ0800 

10500 LET Q-Q-l 

10600 IF S<U-C#V-GX>0 THEN 10800 

10700 LET Q«Q-1 

10800 REM THIS WAS THE EVALUATION SECTION 

10900 REM 

1 1000 NEXT C 



11100 
11200 
11300 
11400 
11500 
11600 
11700 
11800 
11900 
12000 
12100 
1 2200 
12300 
12400 
12500 
12600 
12700 
12800 
12900 
13000 
13100 
13200 
13300 
13400 
13500 
13600 
13700 
13800 
13900 
14000 
14100 
14200 
14300 
14400 
14500 
14600 
14700 
14800 
14900 
1 5000 
15100 
15200 
15300 
15400 
15500 
15600 
15700 
15800 
15900 
16000 
16100 
16200 
16300 
16400 
16500 
16600 
16700 
16800 
16900 
17000 
17100 
17200 
17300 
17400 
17500 
17600 
17700 
17800 
17900 
18000 
18100 
18200 
18300 
18400 
18500 
18600 
18700 
18800 
18900 
19000 
19100 
19200 



LET R(P)»Q 

LETQ-0 

RETURN 

IF P«0 THEN 18800 

FOR J-10T0-10 STEP -1 

FOR F-1TOP 

IF RCF)-J THEN 12000 

NEXT F 

NEXT J 

LET K-F+P 

GOSUB 2300 

RETURN 

PRINT" I MOVE FROM ("XIY") TO <"U;V M ) M 

LET F»0 

LET P«0 

LET K»0 

IF V<X4.5 + (3.5*G)) THEN 13000 

LET S<U#V)-2*G 

GOTO 13100 ' 

LET S(U*V)»S<X»Y) 

LET S(X»Y)«0 

IF ABS(X-UX>2 THEN 13400 

LET S<(X+U)/2*CY+V)/2>»0 

PRINT"B8ARD"J 

INPUT D$ 

IF D$o"YES" THEN 13900 

GOSUB 14100 

RETURN 

GOSUB 15800 

RETURN 

PRINT 

FOR Y-8T01 STEP -1 

FOR X-IT08 

LET I«2*X 

IF S(X#YX>0 THEN 14700 

PRINT TABU)"."; 

IF S(X#YX>1 THEN 14900 

PRINT TAB<I)"0"; 

IF S(X»YX>-1 THEN 15100 

PRINT TAB<I)"X"; 

IF S(XiY)<>-2 THEN 15300 

print tab<d"x";tab(I )"*"; 
if scx*yx>2 then 15500 
print tab<I)"0";tab(I>"*"; 

NEXT X 

PRINT 

NEXT Y 

PRINT 

PR I NT" FROM"; 

INPUT E,H 

LET X»E 

LET Y»H 

IF S<X»YX>0 THEN 16700 

PRINT "THERE IS NO ONE OCCUPING THAT SPACE" 

PRINT 

GOTO 15900 

PRINT"T0"; 

INPUT A*B 

LET X«A 

LET Y«B 

IF S<X#YX0 THEN 17500 

PRINT"THAT SPACE IS ALREADY OCCUPIED" 

PRINT 

GOTO 16700 

LET S(ASB)«S<E#H) 

LET S<A#B)«S(E*H) 

LET S<E*H)=0 

LET T«<4.5-<3.5*G)) 

IF ABS<E-AX>2 THEN 18100 

LET S(<E+A)/2*<H+B)/2)-0 

IF B<>T THEN 18300 

LET S<A»B)»-2*G 

FOR X-8T88 

FOR Y-8T08 

RETURN 

NEXT Y 

NEXT X 

PRINT" 

PRINT 

PRINT 

PRINT" -CHUCK OUT" 

END 



VERY GOOD, YOU WIN!" 



74 



SAMPLE RUN 

THIS PROGRAM WILL PLAY CHECKERS. THE COMPUTER IS X, 
AND YOU ARE 0. THE COMPUTER WILL GO FIRST. -NOTEt SQUARES 
ARE IN THE FQRM-(X*Y) AND SQ» 1*1 IS THE BOTTOM LEFT! 
DO NOT ATTEMPT A DOUBLE JUMP OR YOUR PIECE MIGHT JUST 
DISAPPEAR (SAME FOR A TRIPLE!) 

WAIT FOR THE COMP. TO MOVE!!!!! 

I MOVE FROM < 2 6 ) TO < 1 5 > 
BOARD ?YES 



o.o.o.o. 

.0.0.0.0 

o.o.o.o. 

FROM 71.3 
TO 72*4 

I MOVE FROM C 1 7 ) TO ( 2 6 > 
BOARD ?YES 



. • 


X 


. 


X 


• 


X 


• 


. X 


. 


X 


• 


X 


• 


X 


X . 














. 


• 


• 


• 


• 


• 


• 


. • 





• 





• 





. 


. 


. 





. 





. 





o . 





• 





• 





• 


FROM 


?3**\*\3 






TO 74 


• 4 













I MOVE FROM (2 8 > TO ( 1 
BOARD 7 YES 



. X . X . 


X 


. X 


.0.0. 


. 


. . 


. . . ..0 


• 


. 


.0.0. 





.0 


0.0.0 


• 


. 


FROM 72,4 






TO 71*5 






THAT SPACE 


s 


ALREADY OCCUPIED 


TO 73*5 






I MOVE FROM 


( 1 5 > TO ( 2 


BOARD ?YES 






. . . X . 


X 


. X 


X . X .X 


. 


X . 


. X . x . 


X 


. X 


. . . . 


. 


. • 


. x . o . 


• 


• . 


.... 


• 


o . 


.0.0. 





. 


o.o.o 


• 


. 


FROM ?7*3 






TO 78,4 







I MOVE FROM < 2 6 > TO ( 
BOARD ?YES 



X . X . X . X . 
... X * X . X 
X • 

. X . . . .0 

. . . . . . . 
.0.0.0.0 

o.o.o.o. 



FROM 73*5 
TO 72,6 



I MOVE FROM (1.7 > TO < 3 5 > 
BOARD ?YES 



... X . X . X 

X . X 

. x . o ... 
. . . . o . . . 

.0.0.0.0 

. o . r . o . 

FROM 74*4 
TO 72.6 

1 MOVE FROM (46 ) TO (35 ) 
BOARD ?YES 



. . . . . . 

.o.o.o. 
o.o.o.o 

FROM 72*6 
TO 71*7 



FROM 71 #7 
TO 72*8 

I MOVE FROM ( 4 8 ) TO ( 3 7 ) 
BOARD ?YES 

. 0*. . . X . X 

. * X . X . X . 

• X . . . X . X 
X . X 

. X . • • • • 

• •••o... 

• o.o.o.o 

. .0 .0 . 

FROM 72*8 
TO 74,6 

1 MOVE FROM < 6 6 ) TO C 5 5 > 
BOARD ?YES 

. . . . . X .X 
.... X . X . 

. X . o*. . . X 

. X .... .0 

. . . . o . . . 

• o.o.o.o 
o.o.o.o. 

FROM 74,6 
TO 76*4 

I MOVE FROM (5 7 > TO ( 4 6 > 
BOARD 7YES 

X . X 

...... x . 

. x . x ... X 

X . X 

. X . • • 0* . 
. . . . . . . 
.0.0.0.0 
2RB#9V. 

FROM ?5*2»U 

5*2 ' 

THERE IS NO ONE OCCUPING THAT SPACE 

FROM 75*3 
TO 74*4 

I MOVE FROM ( 6 8 > TO ( 5 7 ) 
BOARD ?YES 

X 

.... X . X • 
••■ X . x ... X 
x . x .... . 

. X . . 0*. 
.0.0.0.0 

o.o.o.o. 

FROM 74*2 
TO ?3#3 

I MOVE FROM ( 5 7 ) TO < 6 6 ) 
BOARD ?YES 

....... X 

x . 

. X . X . X . x 

. X . . 0* . 

. . 

• . • . .0 
0.0.0.0. 

FROM 78 #5 

THERE IS NO ONE OCCUPING THAT SPACE 

FROM 78*4 
TO ?7#5 

I MOVE FROM < 6 6 ) TO < 8 4 ) 
BOARD 7YES 

....... X 

...... X • 

. X .x ... X 

. X . . 0*. X 
. . 

. ... o . 
o.o.o.o. 

FROM 74.4 
TO ?5#5 

I MOVE FROM < 2 4 > TO C. 1 3 > 
BOARD 7YES 

....... X 

x . 

. x . x ... X 
X . X . ♦ . . 

..... 0*. X 

X . 

. ... o . 
o.o.o.o. 



FROM 75*5 
TO 73-* 7 



I MOVE FROM < 7 7 ) TO ( 6 6 > 
BOARD 7YES 



• . 
. X • 
X . X 



X . X 

. . . . . 0*. X 
X . 

. o ... . 

o.o.o.o. 

FROM 73*7 
TO 74*8 

I MOVE FROM C ' 1 5 ) TO ( 2 4 ) 
BOARD 7YES 



O*. • .X 
. . X . X 
. .0*. X 



. ... Q . 
O.O.O.O. 



FROM 73*3 
TO 71*5 



I MOVE FROM < 3 5 > TO (24) 
BOARD 7YES 



.0.0 
0.0. 



. . 

. X . 

X . • 

. • 

. 

FROM 71*5 
TO 73*7 



I MOVE FROM (6 6 > TO ( 7 5 ) 
BOARD 7YES 



AFFFFF2Y2D . 
0.0.0.0 



FROM 73,7 
TO 72*8 



I MOVE FROM (2 4 ) TO ( 3 3 ) 
BOARD 7YES 



• X • 
0* . X 



. . 
. 



FROM 72*2 
TO 74*4 



. 
0.0. 



I MOVE FROM (7 5 ) TO ( 5 3 > 
BOARD 7YES 



• . 
0.0.0. 



FROM 75*1 
TO 74*2 



I MOVE FROM ( 8 4 ) TO ( 7 3 ) 
BOARD 7 YES 





o*. 


0*. 


•■■« 


. x 










X 




* . 


. 


. 


. . 


x . . 


. X 


. > 


c . 


. • ' . 


. 








• 




. 1 


3 • 


FROM 16*2 






TO 


78*4 









VERY GOOD* YOU WIN! 



I MOVE FROM (3 7 ) TO ( 2 6 ) 
BOARD 7N0 



75 



CHEMST 



DILUTE KRYPTOCYANIC ACID 



Description 

The fictitious chemical, kryptocyanic acid, can only be diluted 
by the ratio of 7 parts water to 3 parts acid. Any other ratio 
causes an unstable compound which soon explodes. Given an 
amount of acid, you must determine how much water to add for 
dilution. If you're more than 5% off, you lose one of your 
nine lives. The program continues to play until you lose all 
nine lives or until it is interrupted. 

Program Author 



Wayne Teeter 
312 Peg Street 
Ridgecrest, CA 



93555 



LIST 

10 PRINT "THE FICTICIOUS CHEMICAL KRYPTOCYANIC ACID CAN ONLY BE" 
20 PRINT "DILUTED BY THE RATIO OF 7 PARTS WATER TO 3 PARTS ACIE." 

30 PRINT "IF ANY OTHER RATIO IS ATTEMPTED* THE ACID BECOMES UNSTABLE" 

40 PRINT "AND SOON EXPLODES. GIVEN THE AMOUNT OF ACID* YOU MUST" 

50 PRINT "DECIDE HOW MUCH WATER TO ADD FOR DILUTION. IF YOU MISS" 

60 PRINT "YOU FACE THE CONSEQUENCES." 

100 LET A=INT<RND(1)*50) 

110 LET W=7*A/3 

120 PRINT A"LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER"J 

130 INPUT R 

140 LET D*ABS<W-R> 

150 IF D>W/20 THEN 200 

160 PRINT "GOOD JOB! YOU MAY BREATHE NOW* BUT DON'T INHALE THE FUMES!" 

170 PRINT 

180 GO TO 100 

200 PRINT "SIZZLE! YOU HAVE JUST BEEN DESALINATED INTO A BLOB" 

210 PRINT "OF QUIVERING PROTOPLASM!" 

220 LET T«T*1 

230 IF T=9 THEN 260 

240 PRINT "HOWEVER* YOU MAY TRY AGAIN WITH ANOTHER LIFE*" 

245 PRINT 

250 GO TO 100 

260 PRINT "YOUR 9 LIVES ARE USED* BUT YOU WILL BE LONG REMEMBERED FOR" 

270 PRINT "YOUR CONTRIBUTIONS TO THE FIELD OF COMIC BOOK CHEMISTRY." 

280 END 





RUN 

THE FICTICIOUS CHEMICAL KRYPTOCYANIC ACID CAN ONLY BE 

DILUTED BY THE RATIO OF 7 PARTS WATER TO 3 PARIS ACID. 

IF ANY OTHER RATIO IS ATTEMPTED* THE ACID BECOMES UNSTABLE 

AND SOON EXPLODES. GIVEN THE AMOUNT OF ACID* YOU MUST 

DECIDE HOfc MUCH WATER TO ADD FOR DILUTION. IF YOU MISS 

YOU FACE THE CONSEQUENCES. 

19 LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER? *9 
SIZZLE! YOU HAVE JUST BEEN DESALINATED INTO A BLOB 
OF QUIVERING PROTOPLASM! 
HOWEVER* YOU MAY TRY AGAIN WITH ANOTHER LIFE. 

42 LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER777 
SIZZLE! YOU HAVE JUST BEEN DESALINATED INTO A BLOB 
OF QUIVERING PROTOPLASM! 
HOWEVER* YOU MAY TRY AGAIN WITH ANOTHER LIFE. 

28 LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER? 72 

SIZZLE! YOU HAVE JUST BEEN DESALINATED INTO A BLOB 
OF QUIVERING PROTOPLASM! 

HOWEVER* YOU MAY TRY AGAIN WITH ANOTHER LIFE. 

42 LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER798 
GOOD JOB! YOU MAY BREATHE NOW* BUT DON'T INHALE THE FUMES! 

49 LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER? 112 
GOOD JOB! YOU MAY BREATHE NOW* BUT DON'T INHALE THE FUMES! 

12 LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER728 
GOOD JOB! YOU MAY BREATHE NOW* BUT DON'T INHALE THE FUMES! 

30 LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER775 
SIZZLE! YOU HAVE JUST BEEN DESALINATED INTO A BLOB 
OF QUIVERING PROTOPLASM! 
HOWEVER* YOU MAY TRY AGAIN WITH ANOTHER LIFF. 



76 



CHIEF 



ARITHMETIC PRACTICE 



Description 

In the words of the program author, John Graham, 

"CHIEF is designed to give people (mostly kids) practice in the 
four operations (addition, multiplication, subtraction, and 
division) . 

It does this while giving people some fun. And then, if the 
people are wrong, it shows them how they should have done it. 

It is mostly a game, but can be used by teachers to test the 
kids." 

Program Author 

John Graham 

Friendly Road 

Upper Brookville, NY 11771 



10 

20 

30 

40 

50 

60 

70 

80 

85 

90 

100 

110 

120 

130 

140 

150 

155 

160 

170 

180 

190 

200 

210 
230 
240 
250 
260 
270 
290 
295 

300 

310 
330 
340 
350 
360 
370 
380 
390 

400 

410 
420 
430 
440 
450 
470 
480 
510 
520 



PRINT " I AM CHIEF NUMBERS FREEK, THE GREAT INDIAN MATH GOD " 

PRINT "ARE YOU READY TO TAKE THE TEST YOU CALLED ME OUT FOR"; 

INPUT A* 

IF A*= "YES" THEN 60 

PRINT "SHUT UP PALEFACE WITH WISE TOUNGE. " 



TAKE A NUMBER AND ADD 
'MULTIPLY BY 8. DIVIDE BY 5 AND ADD THE SAME 
'WHAT DO YOU HAVE"; 



DIVIDE THIS NUMBER BY 5 AND" 

SUBTRACT 1. 



WAS I RIGHV. 



SMART, EH? 



PRINT 
PRINT 
PRINT 
PRINT 
INPUT B 

LET C = <B+l-5>*5/8*5-3 

PRINT "I BET YOUR NUMBER WA 

INPUT D* 

IF D*="VES" THEN 510 

PRINT "WHAT WAS YOUR ORIGINAL NUMBER"; 

INPUT K 

LET F=K + 3 

LET G=F/5 

LET H=G*8 

LET I=H/5+5 

LET J=I-1 

PRINT "SO YOU THINK YOU'RE 

PRINT "NOW WATCH. ..." 

PRINT K"PLUS 3 EQUALS "F". THIS DIVIDED BY 5 EQUALS»G", " 

PRINT "THIS TIMES 8 EQUALS"H». IF WE DIVIDE BY 5 AND ADD THE SAME, 

PRINT "WE GET" I". MINUS 1 EQUALS "J". '• 

PRINT "NOW DO YOU BELIEVE ME"; 

INPUT 2* 

IF 2$ ="YES" THEN 518 

PRINT "YOU HAVE MADE ME MAD ! ! ! " 

PRINT "THERE MUST NOW BE A GREAT LIGHTNING BOLT!" 

PRINTSPRINT 

FOR X=38 TO 22 STEP -1 

PRINT TAB<X) "X X" 

NEXT X 

PRINT TAB<21)"X XXX" 

PRINT TAB<28> "X X" 

PRINT TAB<19> "XX X" 

FOR Y=20 TO 13 STEP -1 

PRINT TAB<Y) "X X" 

NEXT V 

PRINT TAB<12> "XX" 

PRINT TAB<11> "X" 

PRINT TAB < 18) »*" 

PRINTSPRINT "########################«########«\PF:INT 

PRINT "I HOPE YOU BELIEVE ME NOW, FOR YOUR SAKE ' ' " 

GOTO 520 

PRINT "BYE! ! ! ! !" 

END 



I AM CHIEF NUMBERS FREEK, THE GREAT INDIAN MATH GOD. 
ARE YOU READY TO TAKE THE TEST YOU CALLED ME OUT FOR? NO 
SHUT UP PALEFACE WITH WISE TOUNGE. 

TAKE A NUMBER AND ADD 3. DIVIDE THIS NUMBER BY 5 AND 
MULTIPLY BY 8. DIVIDE BY 5 AND ADD THE SAME. SUBTRACT 1 
WHAT DO VOU HAVE 
? 3. 8 

I BET YOUR NUMBER WAS -3.625 WAS I RIGHT? NO 
WHAT WAS YOUR ORIGINAL NUMBER? 12 
SO YOU THINK YOU'RE SO SMART, EH? 
NOW WATCH. ... 

12 PLUS 3 EQUALS 15 . THIS DIVIDED BY 5 EQUALS 3 , 
THIS TIMES 8 EQUALS 24 . IF WE DIVIDE BY 5 AND ADD THE SAME, 
WE GET 9.8 . MINUS 1 EQUALS 8.8 . 
NOW DO YOU BELIEVE ME? NO 
YOU HAVE MADE ME MAD! ! ! 
THERE MUST NOW BE A GREAT LIGHTNING BOLT! 



XX 
XX 
XX 
XX 
XX 
X X 
X X 
X X 
X X 
X XXX 
X X 
XX X 

XX 
X X 
XX 
X X 
XX 
XX 
XX 
XX 
XX 



I HOPE YOU BELIEVE ME NOW, FOR YOUR SAKE ! ! 
READY 



77 



CHOMP 



EAT A BIG COOKIE 



Description 



This program is an adaptation of a mathematical game originally 
presented in Scientific American, Jan., 1973. Up to a 9x9 grid 
is set up by you with the upper left square a poison square. 
This grid is the cookie. Players alternately chomp away at the 
cookie from the lower right. To take a chomp, input a row and 
column number of one of the squares remaining on the cookie. 
All of the squares below and to the right of that square, in- 
cluding that square, disappear. 

Any number of people can play — • the computer is only the 
moderator; it is not a player. Two-person strategies are in- 
teresting to work out but strategies when three or more people 
are playing are a real challenge. 

Source 

Peter Sessions 

People's Computer Company 

Menlo Park, CA 94025 




78 



CHOMP IS FOR 1 OR MORE PLAVERS (HUMANS ONLV). " 
HERE'S HOW A BOARD LOOKS <THIS ONE IS 5 BV 7): 



"THE BOARD IS A BIG COOKIE - R ROWS HIGH AND C COLUMNS" 
"WIDE. VOU INPUT R AND C AT THE START. IN THE UPPER LEFT" 
"CORNER OF THE COOKIE IS A POISON SQUARE <P>. THE ONE WHO" 
"CHOMPS THE POISON SQUARE LOSES. TO TAKE A CHOMP, TVPE THE" 
"ROW AND COLUMN OF ONE OF THE SQUARES ON THE COOKIE. " 
"ALL OF THE SQUARES BELOW AND TO THE RIGHT OF THAT SQUARE" 
"(INCLUDING THAT SQUARE, TOO) DISAPPEAR — CHOMP!!" 
"NO FAIR CHOMPING SQUARES THAT HAVE ALREADV BEEN CHOMPED," 
"OR THAT ARE OUTSIDE THE ORIGINAL DIMENSIONS OF THE COOKIE. 

"HERE WE GO. , 



HOW MAN V PL AVERS" 



HOW MANV ROWS" 



PROGRAM LISTING 

109 REM ***THE GAME OF CHOMP*** 

105 REM ***SUBMITTED BV PEOPLES COMPUTER CENTER*** 

110 PRINT 

120 PRINT "THIS IS THE GAME OF CHOMP (SCIENTIFIC AMERICAN, JAN 1973) " 

130 PRINT "WANT THE RULES (1=VES, 0=NO!)"; 

140 INPUT R 

150 IF R=@ THEN 340 

160 F=l 

170 R=5 

180 C=7 

190 PRINT 

200 PRINT 

210 PRINT 

220 GOSUB 540 

230 PRINT 

240 PRINT 

250 PRINT 

260 PRINT 

279. PRINT 

280 PRINT 

290 PRINT 

300 PRINT 

310 PRINT 

320 PRINT 

330 PRINT 

340 PRINT 

350 DIM A(10, 10) 

360 F=0 

370 FOR 1=1 TO 10 

372 FOR J=l TO 10 

375 Ad,J>=0 

377 NEXT J 

379 NEXT I 

380 PRINT 
390 PRINT 
400 INPUT 

410 11=0 

420 PRINT 

430 INPUT 

440 IF R <= 9 THEN 470 

450 PRINT "TOO MANV ROWS (9 IS MAXIMUM). NOW, " .; 

460 GOTO 420 

470 PRINT "HOW MANV COLUMNS"; 

480 INPUT C 

490 IF C O 9 THEN 530 

508 PRINT "TOO MANV COLUMNS (9 IS MAXIMUM). NOW, "; 

510 GOTO 470 

530 PRINT 

540 FOR 1=1 TO R 

550 FOR J=l TO C 

568 fid, J>=1 

570 NEXT J 

580 NEXT I 

590 FK1, 1>=-1 

600 REM PRINT THE BOARD 

610 PRINT 

620 PRINT TRB<?>; "12 3 4 5 6 7 8 9" 

630 FOR 1=1 TO R 

640 PRINT I; TAB<7); 

650 FOR J=l TO C 

66d IF Ad, J>=-1 THEN 700 

670 IF fid,,T> = THEN 728 

680 PRINT "* »; 

699 GOTO 710 

700 PRINT "P "; 
710 NEXT J 
720 PRINT 
730 NEXT I 
740 PRINT 

750 IF F=0 THEN 770 
?6& RETURN 

770 REM GET CHOMPS FOR EACH PLAVER IN TURN 
780 LET 11=11+1 

798 LET P1=I1-INT(I1/P)*P ' 

800 IF PI <> O THEN 820 
810 P1=P 

820 PRINT "PLAVER ";P1 

830 PRINT "COORDINATES OF CHOMP (ROW, COLUMN) 'V 
840 INPUT R1,C1 
850 IF Ri<l THEN 928 
860 IF R1>R THEN 920 
870 IF CK1 THEN 920 
880 IF C1>C THEN 92© 
890 IF fl(Rl,Cl)=0 THEN 920 
900 IF fi(Rl,Cl)=-l THEN 1010 
910 GOTO 940 

920 PRINT "NO FAIR. VOU'RE TRVING TO CHOMP ON EMPTV SPACE! 
930 GOTO 828 
940 FOR I=R1 TO R 
950 FOR J=C1 TO C 
960 fid,J>=0 '''-. ...'■:;-.■:.:• v-.; 

970 NEXT J 

980 NEXT I 

990 GOTO 610 

1800 REM END OF GAME DETECTED IN LINE 900 

1010 PRINT "VOU LOSE, PLAVER ",P1 

1020 PRINT 

1030 PRINT "AGAIN (1=VES; 0=NO!)",- 

1040 INPUT R 

1050 IF R=l THEN 348 

1060 END ' .■:.. ■/,'';;; 

READV 



SAMPLE RUN 

THIS IS THE GAME OF CHOMP (SCIENTIFIC AMERICAN, JftN 1973) 

WANT THE RULES <1=VES, 8=N0!)? 1 

CHOMP IS FOR 1 OR MORE PLAVERS (HUMANS ONLV). 

HERE'S HOW A BOARD LOOKS (THIS ONE IS 5 BV 7) : 

12 3 4 5 6 7 8 9 ■ 
1 p * * * * * * 

3 * * * ,.* * * * 

4 ******* 



THE BOARD IS A BIG COOKIE - R ROWS HIGH AND C COLUMNS 

WIDE. VOU INPUT R AND C AT THE START. IN THE UPPER LEFT 

CORNER OF THE COOKIE IS A POISON SQUARE (P). THE ONE WHO 

CHOMPS THE POISON SQUARE LOSES. TO TAKE A CHOMP, TVPE THE 

ROW AND COLUMN OF ONE OF THE SQUARES ON THE COOKIE. 

ALL OF THE SQUARES BELOW AND TO THE RIGHT OF THAT SQUARE 

dNCLUDING THAT SQUARE, TOO) DISAPPEAR — CHOMP!! 

NO FAIR CHOMPING SQUARES THAT HAVE ALREADV BEEN CHOMPED, 

OR THAT ARE OUTSIDE THE ORIGINAL DIMENSIONS OF THE COOKIE. 

HERE HE GO. 

HOW MANV PLAVERS? 2 
HOW MANV ROWS? 4 
HOW MANV COLUMNS? 7 



12 3 4 5 6 7 8 9 

1 p ***** * 

2 ******* 

3 ***** * * 

4 * * * * * * * 

PLAVER 1 

COORDINATES OF CHOMP (ROW, COLUMN)? 4,6 

12 3 4 5 6 7 8 9 

1 P ***** * 

2 ******* 
2 ******* 
4 ***** 

PLAVER 2 

COORDINATES OF CHOMP (ROW, COLUMN)? 3,3 

12 3 4 5 6 7 8 9 

1 p ***** * 

2 ******* 

3 * * 

4 * * 

PLAVER 1 

COORDINATES OF CHOMP (ROW, COLUMN)? 1, 4 



12 3 
P * * 
* * * 



4 5 6 7 8 9 



PLAVER 2 

COORDINATES OF CHOMP (ROW, COLUMN)? 3, 1 



1 2 3 4 5 6 7 8 9 
P * * 



PLAVER 1 

COORDINATES OF CHOMP (ROW, COLUMN)? 2,: 



1 2 3 4 5 6 7 8 9 



^LfiVER 2 V 
COORD 1 NATES OF CHC-MP (ROW/ COLUMN >?!' 3 

12 3 4 5 6 7 8 9 

;,; 1 P * . .-■::■ :.};■>- 

' 2 * * 

; 3 ■•■■■ ■ 

.;■ 4 ' ' : "'-::^ -./•■■..■■•■ ..'■■■ v ■;•..■::••-. ■ 

PLAVER 1 

COORDINATES OF CHOMP (ROW, COLUMN)? 2,2 



12 3 4 5 6 7 8 9v 
.P * 



PLAVER 2 

COORDINATES OF CHOMP (J?OW, COLUMN)? 1,2 



12 3 4 5 6 7 



PLAVER 1 

COORDINATES OF CHOMP (ROW, COLUMN)? 2, 1 



1 2 34 5 6 7 8 9 
P 



79 



PLAVER 2 

COORDINATES OF CHOMP (ROW, COLUMN)? 3,1 

NO FAIR. VOU'RE TRVING TO CHOMP ON EMPTV SPACE! 

PLAVER 2 

COORDINATES OF CHOMP (ROW, COLUMN)? 1,1 

VOU LOSE, PLAVER 2 



CIYIIW 



CIVIL WAR GAME 



Description 



This simulation is based on 14 battles in the Civil War. Facts 
and figures used are based on the actual occurrence. If you 
follow the same strategy used in the actual battle, the results 
will be the same — generally, this is a good strategy since the 
generals in the Civil War were fairly good military strategists- 
However, you can frequently outperform the Civil War generals, 
particularly in cases where they did not have good enemy in- 
telligence and consequently followed a poor course of action. 
Naturally, it helps to know your Civil War history, although 
the computer gives you the rudiments. 

After each of the 14 battles, your casualties are compared to 
the actual casualties of the battle, and you are told whether 
you win or lose the battle. 

Program Author 

CIVIL WAR was written in 1968 by three students: 

L. Cram, L. Goodie, D. Hibbard 
Lexington High School 
Lexington, MA 02173 




80 



PROGRAM LISTING 



35 PRINT 

40 PRINT 



60 PRINT 
65 PRINT 
70 PRjnT 
75 PRINT 



AND THAT YOUR" 
FIGURES USED ARE" 
ES TEND TO RESULT" 
DEPENDS ON YQUn" 



ATTACK" 

MANUEVERS" 



1 LET L»0lLET w.OjLET R1«0iLET P1«0 

2 LET Oi«0lLET M3"0lLET M4»0 

3 LEy P2«0lLET Ti* *'- e T T2«0 

5 REMARKABLE PRqGrAM BY L. CRAM , L. GooDIE , AND D, 

6 print "Do you wa n t descriptions c0«yes, i«No)"> 

7 INPUT Z 

9 FOR U«l TO 6 

10 PRINT 

11 NEXT U 
13 IF Z"l THEN 100 

15 print "This is a Civil war simulation." 

20 print "to play, type a response when the computer 

30 PRINT "REMEMBER THAT ALL FACTORS ARE INTERRELATED 
"""" "■ "RESPONSES COULD CHANGE HISTORY. FACTS AND 

BASED ON THE ACTUAL OCCURENCE, MOST BATTLES 
45 PRINT "AS THEY DID IN THE CIVIL WAR, BUT IT ALL DE 

50 PRINT 

51 PRINj "THE OBJECT OF THE GAME Ig TO rtIN As HANy BATTLES As POSSIBLE" 

52 PRINT 

55 print "your ch ices For defensive strategy are»" 

(1) artillery attack" 

(2) fortification agaj n st frontal at 

(3) fortification against flanking 

(4) falling back" 

80 PRINT "YOUR CHOICES FOR OFFENSIVE STRATEGY AR£J" 
85 PRINT " CI) ARTILLERY ATTACK" 
90 PRINT « (2) FRONTAL ATTACK" 

95 PRINT " C3) FLANKING MANUEVERS" 

96 PRINT " (4) ENCIRCLEMENT" 

97 PRINT iiYOU MAY SURRENDER BY TYPING A <5< FOR YOUR 

98 PRINT 

99 PRINT "yOu ARE THE CONFEDERACY. GOOD LuCKl" 

100 READ M1,M2,C1,C2,M,A,U 

101 LET I1«10+(l-W)*2 

102 LET I2«10*tw-L)*2 

103 LET oi"100*INT(CMl*(100-Il)/2000)*(l+(Rl-OlJ/(Rl* 

104 LET D2b100*INT(M2*(100».I2)/2000 + 0,5) 

105 LET Fls5*M/6 

106 LET A X -Z 

107 FOR U*l TO 4 

108 PRINT 

109 NEXT U 

110 PRINT "THIS IS THE BATTLE qF "5 
115 GOSUB 800 
120 PRINT « >', "CONFEDERACY", " UNION" 

130 PRINT "MEN"," "»INTCM1*(1*(PI-T1)/(M3+1)))," «> 

131 PRINT INT(M2*(l4.(P2-T2)/(M4 + i))) 
140 PRINT "MONEY", "$" J Di , "$" > D2 

1S0 PRINT "INFLATION", « » ; 1 1 + 15 ! "%" , " »n2>"%" 
160 PRINT 

170 PRINT "HOw MUCH DO yOu 

180 INPUT F 
185 IF F<0 THEN 750 

190 print "How much On you 

S 

THEN 750 

210 print »ho* much do you 

220 INPUT B 

THEN 750 



03* LETM3*'- 

*f :t M4« 

F '14 

661 ■-- 
670 L..,A ^ 
672 DATA 40 



1500 



200 INPUT 
205 IF S< 



wl8 H TO SPEND FOR FOOD" 



WISH TO SPEND FOR SALARIES"! 



wISH yO SPEND FOR AMMUNITION"? 



YOU hAV E only J m Pi 



221 IF B<C 

222 PRINT 

224 IF F + S + 8<bDJ THEN '230 
226 PRINT "THINK AgAINJ 
228 GOTO 160 
230 LET 0»((2*Fa2 + Sa2)/F1a2«-1) 
235 IF O<10 THEN 260 

240 PRINT "MORALE IS HIGH" 

250 GOTO 300 

260 IF 0<5 THEN 290 

270 PRInT "MORALE IS FAIR" 

280 GOTO 300 

290 PRINT "MORALE IS POOR" 

300 IF M<>3 THEN 330 

310 PRINT "YOU ARE ON THE OFFENSIVE" 

320 GOTO 370 

330 IF Moj THEN 360 

340 PRINT "YOu ARE ON THE DEFENSIVE" 

350 GOTO 370 

360 prInt "Both sides are on the offensive" 

370 PRINT 

380 PRINT "YOUR STEGY"? 

390 INPUT Y 

391 IF Y*5 THEN l4 87 

392 IF ABS(v-3)<3 THEN 395 

393 PRIN T "yOu JERKl US E THE OTHER SET OF stRAtEGIE* 

394 GOTO 370 

395 PRINT 

400 PRINT " ",»CONFEDERACY», "UNION" 

410 LET C5»(2*Cl/5)*Cl+l/(2*(AB8(lNT(4*KND(i)+l)-Y)+l 

412 LET c5 1 INT(c 5 *fl + l/O)*(l,2e+Fi/(B+l))+0.5) 

414 if c5+l&0/O<Ml*Cl + (Pl-Tl)/(M3+l)) THEN 42-1 

416 LET C5«INTC13*M1/20*(1+(P1-Ti)/(M3*1))) 

418 LET Es 7 *C5/l3 

420 LET U»l 

422 GOTO 426 

424 LET EM00/O 

426 prInT "CASUALTIES", C5,ImT(17*C2*C1/(C5*20)+0. 5^ 

430 PRInT "DESFrTI0NS",InT(E),InT(5*0) 

432 PRINT 

433 IF C5-C1>*0 THEN 4 39 

435 PRINT "YOUR CASUALTIES WERE" INT ( 100* (Ci -Cg) /C i*0 , 

437 GOTO 441 

439 PRIN T "YOiiR CA 8U ALtIEs wERE" IN T ( 100* (C5-C 1) /C 1+0, 

441 PrINt "the actual casualities At "I 

443 LET AIM 

445 Go SUB800 

450 IF UM THEN 470 

460 IF C54.e<17*C2*C1/(C5*20)+5*O TH£N 490 

470 PRINT "YOU LOSE "! 

471 LET LsL+1 
480 GOTO 555 

490 PRINT "YOU WIN "j 

491 LET Wrnw+i 

555 GOSUB 800 

556 IF w»8 THEN 1490 
580 LET T1M1+C5+E 

590 LET T2»T2+17*C2*C1/(C5*20)+5*O 

600 LET P1«P1+C1 

610 LET P2-P2+C2 

620 LET Q1«Q1+(F*S+B) 

630 LET Rl«Rl+Ml*(100-Il)/20 



5)!"X LESS THAN" 
5)>"% MORE THAN" 



81 



r 18500,1967,2708,1,1,0. 
,44894,10699,13047,3,2,0 
674 DATA 95000,115000,20614,15849,3,3,0 
676 DATA 54000,63000,10000,14000,2,4,0 
678 DATA 40000,50000,10000,12000,3,5,0 
680 DATA 75000,120000,5377,12653,1,6,0 
682 DATA 38000, 45000, 1 1000, 12000, 1 , 7 , 
684 DATA 32000 , 90000, 13000, 17197,2, 9, 
686 DATA 50000*70000,12000,19000,1,9,0 
688 DATA 72500* 85000, 20000, 23000, 3, 10, 
690 DATA 66000, 60000, 18000, 16000, 2#ll»fi 
692 DATA 37000,60000,6700,5800 2,12,0 
694 DATA 62000,110000,17723,16000,2,13,0 
696 DATA 65000,100000,8500,3700,1,14,0 
750 PRINT "GO TO JAIL." 
752 PRINT "GO DIRECTLY TO JAIL." 
754 PRINT "DO NOT PASS GO." 
756 PRINT "DO NOT COLLECT $200" 
758 GOTO 107 
800 IF A<>1 THEN 850 
810 PRINT "BULL RUN" 
820 IF AIM THEn 1480 

830PRINT"JULY 21,1861 GEn. BEAUREGARD COMMANDING ThE SOUTH MET T H F« 
832PRINT"UNI0N FORCES W X T H GEN MCDOWELL IN A PREMATURE 8ATT L E AT BULI~" 
834pRiNT»RUN, GEN. JACKSON HELPED PUSH BACK THE UNION ATTACK." 
840 GO TO 1480 
850 IF A<>2 THEN 900 
860 PRINT "SHILOH" 
870 IF A 1 « 1 THEN i48fl 

880PRIN T "APRIL 6-7,1862 T HE CONFEDERATE SURPRISE ATTACK A T sHILOH" 
882PrINt»FAILED DuE tO POOr OrGANI Z a T ION . « 
890 Go TO 1480 

900 if A03 then 950 
910 print "Seven [>ay5« 

920 IF Al"l THEN 1480 

9 25nL IN J17 UN £ 25 " JU ^ Y 1*1862 GENERAL LEE (CS A ) UPHELD THE OFFENSIVE" 

9 32PRINT«THR0UGH0UT The BATTLE AND FORCED GEN. MCCLELLAN ANn THE UNION" 

934PRINT"F0RCES AWAY FROM RICHMOND." 

940 GO TO J480 

950 IF A<>4 THEN 1000 

960 PRInT "THE SECOND BULL RUN" 

970 IF AIM THEn 1480 

980PRinT"AUG 29-30,1862 ThE COMBINED CONFEDERATE FORCES UNDER l^F AnD" 

982PRiNT"jACKS0N DROVE ThE UNION FORCES BACK INTO WASHINGTON." 

990 GO TO 1480 

1000 IF A<>5 THEN 1050 

1010 PRINT "ANTIETAM" 

1020 IF A t «i THEN 14 8f5 

1030PRINT"SEPT 17,1862 THE sOUT H FAILED TO INCORPORATE MARyLAND INTO" 

1032PrIN T «tHE CONFEDERACY," 

1040 Go TO 1480 

1050 IF A<>6 THEN 11O0 

1060 PRINT "FREDERICKSBURG" 

1070 IF MM THEN 1480 

1080PRINT"DEC 13,1862 THE CONFEDERACY UNDER LEE SUcESSFULLY REPULSED" 

1082PRINT»AN ATTACK BY THE UNION UNDER GEN. BURNSIOE." 

1090 GOTO 1480 

1100 IF A <>7 THEN H50 

1110 PRINT "MuRFREEsBORO" 

1120 IF AIM THEN 1480 

1130prInT«DEC 31,1862 THE SOUTH unDEr GEn. BRAGG Won A CLOSE BATTLE" 

1140 GOTO 1480 

1150 IF A<>8 THEN 1200 

1160 PRINT "CHANCELLORSVILLE" 

1170 IF Al«i THEN 1480 

1180PRINT«M A y 1-6,1863 THE SOUTH HAD A COSTLY Vi C TORY A Np LOST ONf" 

1182PRINT"0F THEIR OUTSTANDING GENERALS, 'STONEWALL' JACKSON." 

1190 GOTO 1480 

1200 IF A<>9 THEN 125* 

1210 PRINT "VICKSBURG" 

1220 IF A i • 1 THEN 1480 

1230PRlNT"JULY 4,1863 VICKSBURG WAS A COSTLY DEFEAT FOR THE SOUTH" 

1232PRI N T«BECAUSE IT GAVE THE UNION ACCESS TO THE MISSISSIPPI." 

1240 GOTO 1480 

1250 IF A<>10 THEN 1300 

1260 PRINT "GETTYSBURG" 

1270 IF A 1 ■ 1 THEN 1480 

1280PRINT"JUNE 30,1863 A SOUTHERN MISTAKE BY GEN, LEE AT GETTYSflURG" 

12 8 2PRINT»C0ST THEM ONE OF THE MOST CRUCIAL BATTLES OF THR *AR." 

1290 GOTO 1480 

1300 IF A <> i i THEN 1350 

1310 PRINT "CHICKAMAUGA" 

1320 IF Al«l THEN 1480 

1330PRINT"NOV 25,1863 

1332PRinT"ARmY FqR ThREE 

1340 GOTO 1480 

1350 IF A<>12 THEN 1400 

1360 PRINT "CHATTANOOGA" 

1370 IF AIM THEN U80 

138 PRINT"SEPT 15,1863 

1382PRINT"T0 A COSTLY SOUTHERN VICTORY 

1390 GOTO 1480 

1400 IF A<>13 THEN 1450 

1410 PRINT "SPOTSYLVANIA" 

1420 IF AIM THEN 1480 

1430PRiNT"MAY 5,1664 GRANT'S PlAn TO KEFp L EE ISOLATED BEGAN T FA IL " 

1432PRiNT" H ERE, AND CONTINUED AT COLD HARBOR AND PETERSBURG." 

1440 GOTO 1480 

1450 PRINT "ATLANTA" 

1460 IF Alal THEN l 4 e* 

1470PRINT«AU6UST, t 864 SHERMAN AND THREE VETERAN ARMTES CONVERGED ON" 

1472PRINT"ATLANTA AND DEALT THE DEATH BLOW TO THE CONFEDERACY » 

1480 PRINT * 

1485 RETURN 

1487 PrI^Jt "THE CONFEDERACY HA 9 SURRENDERED" 

1488 goto 1500 

1490 print »t h e union h as surrendered" 

1500 PRINT 

1510 PRINT "YOU HAVE WON" Wj "BATTLES AND LOST" L| "BATTLES." 

1515 IF Y»5 THEN 1550 

1520 IF W<«L THEN I550 

1530 PRINT "THE CONFEDERACY HAS WON THE WAR" 

1540 STOP 

1550 PRINT "THE UNION HAS WON T HF WAR" 

1560 END 



AFTER THE SOUTH HAD SIEGED GEn, ROSEnCRAnS' 
MONTHS, GEN, GRANT BROkE T H E SlEGE." 



CONFUSION IN a FOREST NEAR CHICKAMAUGA LED" 



DO YOU WANT DESCRIPTIONS <8=VES, l=NO>? 

SAMPLE RUN 



THIS IS A CIVIL WAR SIMULATION. 

TO PLAY, TVPE A RESPONSE WHEN THE COMPUTER ASKS. 
REMEMBER THAT ALL FACTORS ARE INTERRELATED AND THAT VOUR 
RESPONSES COULD CHANGE HISTORV. FACTS AND FIGURES USED ARE 
BASED ON THE ACTUAL OCCURENCE. MOST BATTLES TEND TO RESULT 
AS THEV DID IN THE CIVIL WAR, BUT IT ALL DEPENDS ON VOU ! ! 

THE OBJECT OF THE GAME IS TO WIN AS MANV BATTLES AS POSSIBLE 

VOUR CHOICES FOR DEFENSIVE STRATEGY ARE : 

<1> ARTILLERY ATTACK 

<2> FORTIFICATION AGAINST FRONTAL ATTACK 

.:: 3 ) FORT I F I CAT I ON AGA INST FLANK I NG MANUEVERS 

(4) FALLING BACK 
VOUR CHOICES FOR OFFENSIVE STRATEGY ARE: 

<1> ARTILLERY ATTACK 

<2) FRONTAL ATTACK 

0> FLANKING MANUEVERS 

<4> ENCIRCLEMENT 
VOU MAY SURRENDER BY TYPING A 



FOR YOUR STRATEGY. 



THIS IS THE BATTLE OF CH ICKAMAUGA 

NOV 25,1863 AFTER THE SOUTH HAD SIEGED GEN. ROSENCRANS 

ARMY FOR THREE MONTHS, GEN. GRANT BROKE THE SIEGE. 

CONFEDERACY UNION 
MEN 65389 62146 

MONEY $ 270680 * 294000 

INFLATION 32 X 2 X 

HOW MUCH DO VOU WISH TO SPEND FOR FOOD? 80000 
HOW MUCH DO YOU WISH TO SPEND FOR SALARIES? 80000 
HOW MUCH DO YOU WISH TO SPEND FOR AMMUNITION? 110600 

MORALE IS FAIR 

BOTH SIDES ARE ON THE OFFENSIVE 

VOUR STEGY? 1 

CONFEDERACY UNION 
CASUALTIES 18172 13471 

DESERTIONS 13 36 

VOUR CASUALTIES WERE 1 X MORE THAN 
THE ACTUAL CASUALITIES AT CH ICKAMAUGA 

VOU LOSE CHICK AM AUG A 



VOU ARE THE CONFEDERACY. 



GOOD LUCK! 



THIS IS THE BATTLE OF BULL RUN 

JULY 21,1861 GEN. BEAUREGARD COMMANDING THE SOUTH MET THE 
UNION FORCES WITH GEN MCDOWELL IN A PREMATURE BATTLE AT BULL. 
RUN. GEN. JACKSON HELPED PUSH BACK THE UNION ATTACK. 

CONFEDERACY UNION 

MEN 1800O 18500 

MONEY $ 81000 * 8 23 00 

INFLATION 25 X 10 X 

HHW MUCH DO VOU WISH TO SPEND FOR FOOD? 4088 
HOW MUCH DO VOU WISH TO SPEND FOR SALARIES? 4888 
HOW MUCH DO VOU WISH TO SPEND FOR AMMUNITION? 72008 

MORALE IS POOR . 

VOU ARE ON THE DEFENSIVE 



YOUR STEGY? 1 



CASUALTIES 
DESERTIONS 



ONFEDERACY 



VOUR CASUALTIES WERE 22 X MORE THAN 
THE ACTUAL CASUALITIES AT' BULL. RUN 



VOU LOSE BULL RUN 



THIS IS THE BATTLE OF CHATTANOOGA 

5 E P T 1 5 , 1 8 6 3 C N F U S I N I N A F REST N E A R C H I C KAMA U G A L. E D 

TO A COSTLY SOUTHERN VICTORY. 

CONFEDERACY UNION 
MEN 26680 62168 

MONEY $ 148000 . * 208000 

INFLATION 25 X OX 

HOW MUCH DO VOU WISH TO SPEND FOR FOOD? 40888 
HOW MUCH DO VOU WISH TO SPEND FOR SALARIES? 48888 
HOW MUCH DO VOU WISH TO SPEND FOR AMMUNITION? 68888 

MORALE IS FAIR 

BOTH SIDES ARE ON THE OFFENSIVE 

VOUR STEGY? 1 

CONFEDERACY UNION 
CASUALTIES 6767 4881 

DESERTIONS 16 28 

VOUR CASUALTIES WERE 1 X MORE THAN 
THE ACTUAL CASUALITIES AT CHATTANOOGA 



VOU LOSE CHATTANOOGA 



THIS IS THE BATTLE OF SHILOH 

APRIL 6-7,1862 THE CONFEDERATE SURPRISE ATTACK AT SHILOH 

FAILED DUE TO POOR ORGANIZATION. 

CONFEDERACY UNION 

MEN 28856 46878 

MONEY * 176888 * 286588 

INFLATION 27 X 8 X 

HOW MUCH DO YOU WISH TO SPEND FOR FOOD? 28880 
HOW MUCH DO YOU WISH TO SPEND FOR SALARIES'" 1 20800 
HOW MUCH DO VOU WISH TO SPEND FOR AMMUNITION? 1:1.6888 



THIS IS THE BATTLE OF SPOTSYLVANIA 

MAY 5,1864 GRANT-' S PLAN TO KEEP LEE ISOLATED BEGAN TO FAIL 

HERE, AND CONTINUED AT COLD HARBOR AND PETERSBURG. 

CONFEDERACY UNION 

MEN 61488 112884 

MONEY $ 241888 * 561088 

INFLATION 27 X -2 X 

HOW MUCH DO VOU WISH TO SPEND FOR FOOD? 78888 
HOW MUCH DO YOU WISH TO SPEND FOR SALARIES? 78808 
HOW MUCH DO YOU WISH TO SPEND FOR AMMUNITION? 181888 

MORALE IS FAIR 

BOTH SIDES ARE ON THE OFFENSIVE 



MORALE IS POOR 
VOU ARE ON THE 



VOUR STEGY? 2 



CONFEDERAL: 
CASUALTIES 18187 
DESERTIONS 29 



UNION 
1.1748 
17 : 



VOUR CASUALTIES WERE 6 X LESS TrlA 
THE ACTUAL CASUALITIES AT SHI LOW 



YOUR STEGY? : 








CONFEDERACY 


UNION 


CASUALTIES 


21929 


12265 


DESERTIONS 


15 


22 



VOUR CASUALTIES WERE 24 X MORE THAN 
THE ACTUAL CASUALITIES AT SPOTSYLVANIA 



VOU LOSE SPOTSYLVANIA 



VOU WIN SHILOH 



THIS IS THE BATTLE OF SEVEN DAYS 

JUNE 25- JULY 1,1862 GENERAL LEE <CSFl) UPHELD THE OFFENSIVE 
THROUGHOUT THE BATTLE AND FORCED GEN. MCCLELLAN AND THE UNION 
FORCES AWAY FROM ' RICHMOND. 







CONFEDERACY 


UNION 


MEN 




95879 


118818 


MONEY 




* 427588 


* 517588 


I NFL at: 


TON 


25 X 


10 X 



HOW MUCH DO YOU WISH TO SPEND FOR FOOD? 28000, 
HOW MUCH DO YOU WISH TO SPEND FOR SALARIES? 6888 
HOW MUCH DO YOU WISH TO SPEND FOR AMMUNITION? 16758 

MORALE IS POOR 

VOU ARE ON THE OFFENSIVE 



THIS IS THE BATTLE OF ATLANTA 

AUGUST, 1864 SHERMAN AND THREE VETERAN ARMIES CONVERGED ON 

ATLANTA AND DEALT THE DEATH BLOW TO THE CONFEDERACY. 





CONFEDERACY 


UNION 


MEN 


64188 


102651 


MONEY 


f 2478O0 


■$ 528 8 8 


INFLATION 


29 X 


-4. X 



HOW MUCH DO YOU WISH TO SPEND FOR FOOD? 70888 
HOW MUCH DO YOU WISH TO SPEND FOR SALARIES? 78888 
HOW MUCH DO YOU WISH TO SPEND FOR AMMUNITION?' 187888 

MORALE IS FAIR 

VOU ARE ON THE DEFENSIVE 

VOUR STEGY? 2 





CONFEDERACY 


UNION 


CASUALTIES 


8855 


2819 


DESERTIONS 


16 


28 



CASUALTIES 
DESERTIONS 



CONFEDERACY 
48882 



UNION 
6886 



YOUR CASUALTIES WERE 98 X MORE THAN 
THE ACTUAL CASUALITIES AT SEVEN DAYS 



YOU LOSE SEVEN DAYS 



VOUR CASUALTIES WERE 4 X MORE THAN 
THE ACTUAL CASUALITIES AT ATLANTA 



VOU LOSE ATLANTA 



VOU HAVE WON 2 BATTLES AND LOST 11 BATTLES. 
OZ THE UNION HAS WON THE WAR 



CRAPS 



GAME OF CRAPS (DICE) 



Description 



One of the more popular computer games , six versions of CRAPS 
were submitted (although three appear to be virtually the same 
program). The version published here is based on standard 
Nevada craps table rules. That is: 

1. A 7 or 11 on the first roll wins 

2. A 2, 3, or 12 on the first roll loses 

3. Any other number rolled becomes your "point." You 
continue to roll; if you get your point , you win. 
If you roll a 7, you lose and the dice change hands 
when this happens. 

Your stake is set in Statement 210; this could be changed to 
an input statement if desired. 

Source 

An interesting version of CRAPS was submitted by Philip Bieluch 
of Trinity College which uses a file to keep track of prior 
winnings and/or losses. A short but complete version was sub- 
mitted by George Gidzinski of Adlai Stevenson High School , 
Prairie View/ Illinois. 

The published version has been circulating around DIGITAL and 
its users for years. The original author is unknown. 

Digital Equipment Corp. 
Maynard, MA 01754 





83 



PROGRAM LISTING 



90 
160 

110 

120 
138 
140 
150 
160 
170 
180 
135 
190 

200 

219 
215 
216 

21? 
220 
230 
249 
250 
260 
270 
280 
290 

300 

310 
320 
330 
340 
350 
36 
370 
380 
39 

400 

410 
420 
430 
440 
458 
460 
470 
480 
490 

500 

510 
520 
530 
540 
550 

5 60 
570 
580 
598 

600 

618 
620 

6 38 
648 
650 
66 8 
6 70 
630 
698 

700 

710 
720 
730 
740 
758 
760 
770 



830 
840 
850 



830 
898 

900 

918 
920 
930 
940 
950 

see 

970 
930 
990 

1000 
1010 
1020 
1030 
1040 
1050 
1060 
1070 
1080 
1090 
1100 
1110 

1:120 
1130 



RANDO 
FOR I 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
LET Z 
PRINT 
IF B* 

GO TO 

PRINT 

PRINT 

PRINT 

IF N- 

LET U 

PRINT 

PRINT 

PRINT 

GOTO 

LET 

PRINT 

PRINT 

PRINT 

LET Q 

PRINT 

INPUT 

PRINT 

IF B = 

PRINT 

PRINT 

GOTO 

IF B = 

IF B 

PRINT 

GOTO 

LET i 

LET D 

LET Q. 

LET S 

IF W> 

PRINT 

GOTO 

PRINT 

IF Q< 

IF (. 

IF C. 

IF u: 

PRINT 

GOTO 

PRINT 

LET P 

GOTO 

PRINT 

LET C 

IF U>i 

LET 2 

GO TO 

LET 

GOTO 

PRINT 

LET C 

IF W> 

LET 2 

GOTO 

LET 2 

PRINT 

IF 2< 

PRINT 

IF C> 

PRINT 

PRINT 

LET W 

LET 

GOTO 

IF S< 

PRINT 

LET C 

IF W>i 

LET 2 

GOTO 

LET 2 

GOTO 

IF S 

PRINT 

GOTO 

IF WM 

PRINT 

LET C 

LET 2 

GOTO 

PRINT 

LET C 

LET 2' 

GOTO ' 

PRINT 

PRINT 

GOTO 

PRINT 

PRINT 

PRINT 

CHAIN: 

END 



MI2E 

=1 TO 10\PRINT\NEXT I 

THIS DEMONSTRATION SIMULATES ft CRflP GAME WITH THE COMPUTER" 

AS YOUR OPPONENT. THE RULES ARE SIMPLE:" 

*A 7 OR 11 ON THE FIRST ROLL WINS" 
" *fl 2, 3 OR 12 ON THE FIRST ROLL LOSES" 

"ANY OTHER NUMBER ROLLED BECOMES YOUR 'POINT-'* YOU CONTINUE" 

"TO ROLL... IF YOU GET YOUR POINT, YOU WIN. IF YOU ROLL A 7," 

"YOU LOSE. THE DICE CHANGE HANDS WHEN THIS HAPPENS. " 
"JUST BET *0 TO QUIT. " 



5*INT<18+il*RND<0>> 
"ARE YOU READY".; \ INPUT B$ 
= "VES" THEN 228UF B*="NO" 



THEN PRINT "I'LL REPEAT MYSELF THEN 



"SPLENDID YOU ARE GIVEN " ,' 2.; " DOLLARS TO PLAY. WITH. 



2* I NT < N/2 > =8 THEN 218 
= -1 

I'LL ROLL FIRST 



258 
= 1 

YOU ROLL FIRST. 



"HOW MUCH DO YOU BET" 
B 

INT(B) THEN 438 

"NO COINS PERMITTED. . 
360 



. JUST BILLS, PLEASE. 



D2.; 
D2.; 



THEN 1096 
2+1 THEN 470 

"DON'T TRY TO BET MORE THAN YOU HAVE, PLEASE. 
360 

1=INT<6+RND<8>+1> 
2=INT<6+RND<8>+i> 
= + 1 

D1 + D2 
THEN 548 

I ROLL "; Dl.; "AND 
550 

"YOU ROLL "; Dl; "AND 

1 THEN 868 
-2> + <S-3> + <:S-12>=0 THEN 648 
-?>*.::S-11>=0 THEN 718 
THEN 610 

"SO MY POINT IS".; S 
620 

"SO YOUR POINT IS"; S 
= 5 
470 

"AND CRAP OUT. . . " 
= 1 

8 THEN 698 
>Z + B 

= 2-B 

7 70 
"AND PASS. ..." 

= 1 

8 THEN 768 
2-B 
78 



1 THEN 1868 
"YOU NOW HAVE ".; 2.; " DOLLARS " 

THEN 828 
"CHANGE DICE NOW. . . " 



= W*C 

= 

268 

7 THEN 940 

"AND LOSE. . . " 
= -1 

THEN 920 
= 2 + B 
770 
= Z-B 
778 
P THEN 970 

ROLL AGAIN. " 

THEN 1820 

"AND MAKE MY POINT" 

1 
= 2-B 
770 

"AND MAKE YOUR POINT" 

1 

2 + B 



"YOU HAVE RUN OUT OF MONEY. . . . SORRY ABOUT THAT. 

1118 
"THANKS FOR THE GAME. AND CONGRATULATIONS" 
"FOR BEING ABLE TO QUIT WHILE YOU WERE AHEAD. " 

SPRINTSPRINT 
DEMOES" 



SAMPLE RUN 

THIS DEMONSTRATION SIMULATES A CRAP GAME WITH THE COMPUTER 
AS YOUR OPPONENT. THE RULES ARE S IMPLE : 

*A 7 OR 11 ON THE FIRST ROLL WINS 

* A 2, 2 OR 12 ON THE FIRST ROLL LOSES 

ANY OTHER NUMBER ROLLED BECOMES YOUR 'POINT'* YOU CONTINUE 
TO ROLL... IF YOU GET YOUR POINT, YOU WIN. IF YOU ROLL. A 7, 
YOU LOSE. THE DICE CHANGE HANDS WHEN THIS HAPPENS. 
JUST BET $0 TO QUIT. 



ARE YOU READY? YES 

SPLENDID. .... YOU ARE GIVEN 95 DOLLARS TO PLAY WITH. 



YOU ROLL FIRST. . . . 

HOW MUCH DO YOU BET? 18 

YOU ROLL 1 AND 6 AND PASS 

YOU NOW HAVE 185 DOLLARS 
HOW MUCH DO YOU BET? 18 



YOU ROLL 5 AND 

YOU ROLL 3 AND 

YOU ROLL 3 AND 

YOU ROLL 4 AND 



5 SO YOUR POINT IS 18 

5 . . . ROLL AGAIN. 
3 . . . ROLL AGAIN. 

6 AND MAKE YOUR POINT 



YOU NOW HAVE 115 DOLLARS 
HOW MUCH DO YOU BET? 10 

YOU ROLL 2 AND 2 SO YOUR POINT IS 4 
YOU ROLL 1 AND 5 ...ROLL AGAIN. 
YOU ROLL 4 AND 3 AND LOSE. . . 

YOU NOW HAVE 185 DOLLARS 
CHANGE DICE NOW. . . 

HOW MUCH DO YOU BET? 18 

I ROLL 2 AND 5 SO MY POINT IS 8 

I ROLL 4 AND 5 ... ROLL AGAIN. 

I ROLL 2 AND 1 . . . ROLL AGAIN. 

I ROLL 4 AND 4 AND MAKE MY POINT 

YOU NOW HAVE 95 DOLLARS 
HOW MUCH DO YOU BET? 18 



2 SO MY POIJMT IS 8 

ROLL AGAIN. 

ROLL AGAIN. 

ROLL AGAIN. 

ROLL AGAIN. 

ROLL AGAIN. 
6 AND MAKE MY POINT 



I ROLL 


6 


AND 


I ROLL 


4 


AND 


I ROLL 


5 


AND 


I ROLL 


5 


AND 


I ROLL 


1 


AND 


I ROLL 


4 


AND 


I ROLL 


2 


AND 



YOU NOW HAVE 85 DOLLARS 
HOW MUCH DO YOU BET? 18 



I ROLL 


2 


AND 


2 S 


MY P 


UNT IS 


I ROLL 


4 


AND 


1 . 


. ROLL 


AGAIN. 


I ROLL 


2 


AND 


1 . 


. ROLL 


AGAIN. 


I ROLL 


1 


AND 


5 . 


. ROLL 


AGAIN. 


I ROLL 


4 


AND 


2 


. ROLL 


AGAIN. 


I ROLL 


4 


AND 


5 . 


. ROLL 


AGAIN. 


I ROLL 


4 


AND 


6 . 


. ROLL 


AGAIN. 


I ROLL 


6 


AND 


2 


. ROLL 


AGAIN. 


I ROLL 


4 


AND 


4 . 


. ROLL 


AGfilN. 


I ROLL 


6 


AND 


2 . 


. ROLL 


AGAIN. 


I ROLL 


2 


AND 


4 . 


. ROLL 


AGAIN. 


I ROLL 


, 2 


AND 


3 . 


. ROLL 


AGAIN. 


I ROLL 


6 


AND 


6 . 


: ROLL 


AGAIN. 


I ROLL 


1 


AND 


6 A 


W LOSE. . . 



YOU NOW HAVE 95 DOLLARS 
CHANGE DICE NOW. . 



HOW MUCH DO YOU BET? 



6 AND PASS. 



YOU NOW HAVE 185 DOLLARS 
HOW MUCH DO YOU BET? 10 



YOU ROLL 
YOU ROLL 
YOU ROLL 
YOU ROLL 
YOU ROLL 
YOU ROLL 



AND 
AND 
AND 
AND 
AND 
AND 



6 SO YOUR POINT IS 
3 . . .ROLL AGAIN. 
2 ... ROLL AGAIN. 
2 ... ROLL AGAIN. 
1 . . . ROLL AGAIN. 
5 AND LOSE. . . 



YOU NOW HAVE 95 DOLLARS 
CHANGE DICE NOW. 



HOW MUCH DO YOU BET? 8 



THANKS FOR THE GAME. AND CONGRATULATIONS 
FOR BEING ABLE TO QUIT WHILE YOU WERE AHEAD. 



84 



CUBE 



TRAVEL ACROSS A 3-D CUBE 



Description 



CUBE is a game played on cube with a side dimension of 2. a 
location is designated by three numbers — e.g., 1, 2, 1. The 
object is to travel from 1, 1, 1 to 3, 3, 3 by moving one 
horizontal or vertical (not diagonal) square at a time without 
striking one of 5 randomly placed landmines. You are staked 
to $500; prior to each play of the game you may make a wager 
whether you will reach your destination. You lose if you hit 
a mine or try to make an illegal move — i.e., change more than 
one digit from your previous position. 

Program Author 

Jerimac Ratliff 
5462 Woodway Drive 
Fort Worth, TX 76133 



■v.* 



I|3,S 



W 




3il,3 



3,1 .1 



PROGRAM LISTING 



100 PRINT«'D0 YOU WANT TO SEE THE INSTRUCTIONS** ( YES*-1 ,N0— ) v 
H0 INPUT 87 
120 IF 87i0 THEN 370 

130_PRlNT"THI5 IS _A GAME IN WHICH YOU WILL BE PLAYING AGAINST THE" 
140 PRInT»RANDUM DECISION OF THE COMPUTER, THE FIELD OF PLAY IS A" 
150 PRINT"CUBE OF SIDE 3. ANY OF THE 27 LOCATIONS CAN BE DESIGNATED" 
160 PRINT»BY INPUTING THREE NUMBERS SUCH AS 2,3,1. AT THE START," 
170 PRINT«YOU ARE AUTOMATICALLY AT LOCATION 1,1,1, THE OBJECT OF" 
180 PRINT"THE GAME IS TO GET TO LOCATION 3,3,3, ONE MINOR DETAIL," 
190 PRINT«THE COMPUTER WILL PICK, AT RANDUM,5 LOCATIONS AT WHICH" 
200 PRINT«IT WILL PLANT LAND MINES, IF YOU MIT ONE OF THESE LOCATIONS," 
210 PRINT"Y0U LOSE, ONE OTHER DETAIL, YOU MAY MOVE ONLY ONE SPACE " 
220 PRINT»IN ONE DIRECTION EACH MOVE, FOR EXAMPLE* FROM 1,1,2 YOU" 
230 PRINT«MAY MOVE TO 2,1,2 OR 1,1,3, YOU MAY NOT CHANGE" 
240 PRINT"TW0 OF THE NUMBERS ON THE SAME MOVE, IF YOU MAKE AN ILLEGAL" 
350 PRINT"MOVE, YOU LOSE AND THE COMPUTER TAKES THE MONEY YOU MAY" 
260 PRINT»HAVE BET ON THAT ROUND," 
270 PRINT 
280 PRINT 

290 PRINT"ALL YES OR NO QUESTIONS WILL BE ANSWERED BY A 1 FOR YES" 
300 PRINT'iQR A (ZERO) FOR No." 
310 PRINT 

320 PRINT"WHEN STATING THE AMOUNT OF A WAGER, PRINT ONLY THE NUMBER" 
330 PRlNT"OF DOLLARS (EXAMPLE! 250) YOU ARE AUTOMATICALLY STARTED WITH A" 
340 PRINT"500 DOLLAR ACCOUNT," 
350 PRINT 

360 PRINT"GOOD LUCK" 
370 LET Al»500 
380 LET A*INT(3*CRND(X))> 
390 IF A<>0 THEN 410 
400 LET A*3 

410 L£TB«INT(3*(RND(X)n 
420 IPBO0THEN440 
430 LET B»2 

440 LETC«INT(3*(RND(Xm 
450 IFCO0THEN470 
460 LETC«3 

470 LETP»INT(3*(RND(X))) 
480 IFDO0THEN500 
490 LETD-1 

500 LETE«INT(3*(RND(X))) 
510 IFEO0THEN530 
520 LETE«3 

530 LETF«INT(3*(RNO(X))) 
540 IFFO0THEN560 
550 LETF»3 

S60 LETG«INT(3*(RND(X))) 
570 IFGO0THEN590 
580 LETG«3 . 

590 LETH»INT(3*(RNDCX))) 
600 IFHO0THEN620 
610 LETH»3 

620 LETI«INT(3*(RNO(X))3 
830 IFIO0THEN650 
640 LETI*2 

650 LETJ«INT(3*(RND(X))) 
660 IFJO0THEN680 
670 LETJ-3 

'680 LETK*INT(3*(RNP(*D)) 
690 IFKO0THEN710 
700 LETK»2 

710 LETL«INT(3*(RND(X))) 
720 IFL<>0THEN740 
730 LETL*3 

740 LETM«INTC3*(RND(X))) 
750 IFMO0THEN770 
760 LETM«3 

770 LETN«INT(3*(RND(X)5) 
780 IFNO0THEN800 
790 LET N*l 

800 LET 0«INT (3*(RND(X))V 
810 IF <>0 THEN 830 
820 LET 0«3 

830 PRINT "WANT TO MAKE A WAGER?" 
840 INPUT Z 
850 IF Z«0 THEN 920 
860 PRINT "HOW MUCH?" 
870 INPUT Zl 
876 IF AKZ1 THEN 1522 
880 LET W«l 
890 LET X«l 
900 LET Y«l 
910 PRINT 

920 PRINT "ITS YOUR MOVE" 
930 INPUT P,Q,R 
940 IFP>W+1 THEN1030 
950 IFP*W + 1TH£N1000I 
960 IFQ>X+1 THEN1030 
WTF W(X+1) THEN 1010 
980 IF R >(Y+1) THEN 1030 
990 GO TO 1050 
1000 IF Q>« X*l THEN 1030 
1010 IF R>"Y+1 THEN 1030 
1020 GO TO 1050 

1030 PRINT "ILLEGAL MOVE", "YOU LOSE" 
1040 GO TO U40 
1050 LET W«P 
1060 LET x«Q 
1070 LET Y«R 
1080 IF P»3 THEN 1100 
1090 GO TO 1130 
1100 IF Q»3 THEN 1120 
1110 GO TO 1130 
1120 IF R«3 THEN 1530 
1130 IF P«A THEN 1150 
1140 GO TO 1180 
1150 IF Q»B THEN 1170 
1160 GO TO 1180 
1170 IF R«C THEN1400 
1180 IF P«D THEN 1200 
1190 GO TO 1230 
1200 IF Q«E THEN 1220 
1210 GO TO 1230 
1220 IF R«F THEN 1400 
1230 IF P«G THEN1250 
1240 GO TO 1280 
1250 IF Q*H THEN1270 
1260 GO TO 1280 
1270 IF R»ITHEN 1400 86 



1280 IF P«J THEN 1300 

1290 GO TO 1330 

1300 IF Q«K THEN1320 

1310 GO TO 1330 

1320 I IF R»L THEN 1440 

1330 IF P«M THEN 1350 

1340 GO TO 1380 

1350 IF Q«N THEN 1370 

1360 60 TO 1380 

1370 IF R«0 THEN1400 

1380 PRINT "NEXT MOVE" 

1390 GO TO 930 

1400 PRINT"******BANG******" 

1410 PRINT "YOU LOSE" 

1420 PRINT 

1430 PRINT 

1440 If Z«0 THEN 1580 

"1450 PRINT 

1460 LET Z2M1-Z1 

1470 IF Z2>0 THEN 1500 

1480 PRINT "YOU BUST" 

1490 GO TO 1610 

1500 PRINT " YOU NOW HAVE»I Z2! "DOLLARS" 

1510 LET A1«Z2 

1520 GO TO 1580 

1522 PRINT»TRIED TO FOOL MEl BET AGAIN"! 

1525 GO TO 870 

1530 PRINT"CONGRATULATIONS" 

1540 IF Z«0 THEN 1580 

T550 LET Z 2 ■ A 1 + Z 1 

1560 PRINT "YOU NOW HAVE"! Z2! "DOLLARS" 

1570 LET Al«Z2 

1580 PRINT"DO YOU WANT TO TRY AGAIN?" 

1590 INPUT S 

1600IF SM THEN 380 

r6l"0 PRINT "TOUGH LUCK" 

1620 PRINT 

1630 PRINT » GOODBYE" 

1640 END 



SEE THE INSTRUCTIONS? (VES — 1, NO — @) 



SAMPLE RUN 

DO VOU WANT TO 

? 1 

THIS IS A GAME IN WHICH VOU WILL BE PLAYING AGAINST THE 

RANDUM DECISION OF THE COMPUTER. THE FIELD OF PLAY I'-" A 

CUBE OF SIDE 3. ANY OF THE 2? LOCATIONS CRN BE DESIGNATED 

BV INPUTING THREE NUMBERS SUCH AS 2,2,1. AT THE START. 

V U A R E A U T M A T I C ALLY AT L C A T I N 1,1,1. THE B J E C T F 

THE GAME IS TO GET TO LOCATION 2,3,2. ONE MINOR DETfilL. 

THE COMPUTER WILL PICK, AT RANDOM, 5 LOCATIONS AT WHICH 

IT WILL PLANT LAND MINES. IF VOU HIT ONE OF THESE LOOftT I fiN'^ . 

VOU LOSE. ONE OTHER DETAIL, VOL! MAV MOVE ONLV ONE SPAHE 

IN ONE DIRECTION EACH MOVE. FOR EXAMPLE: FROM LI. 2 vnil 

MAV MOVE TO 2,1,2 OR 1,1,2. VOU MAV NOT CHANGE 

TWO OF THE NUMBERS ON THE SAME MOVE. IF VOU MAKE AN ILLEGAL 

MOVE, VOU LOSE AND THE COMPUTER TAKES THE MONEV Vflll MAV 

HAVE BET ON THAT ROUND. 



ALL VES OR NO QUESTIONS WILL BE ANSWERED BV A 1 FHR VES 
OR A O <2ER0) FOR NO. 

WHEN STATING THE AMOUNT OF A WAGER, PRINT fiNlV THE NUMBER 

OF DOLLARS (EXAMPLE: 250) VOU ARE AUTOMATICALLY STARTED WITH A 

590 DOLLAR ACCOUNT. 

GOOD LUCK 

WANT TO MAKE A WAGER? 

■■? 1 

HOW MUCH? 



ITS VOUR. MOVE 
? 1,1,2 
NEXT MOVE 
? 1, 2, 2 
NEXT MC ,ve 
? 1, 2, 3 



NEXT MOVE 

? 2, 2, 3 

NEXT MOVE 

? 2, 3, 3 

NEXT; MOVE 

? 3,3,3 

CONGRATULATIONS 

VOU NOW HAVE 550 DOLLARS 

DO VOU WANT TO TRY AGAIN"' 

? 1 

WANT TO MAKE A WAGER? 

? 1 

HOW MUCH? 

? 50 

ITS VOUR MOVE 

? 1, 2, 1 

NEXT MOVE .:■'•'•■ 

? 2,2, 1 

NEXT MOVE 

? 2,2, 2 

NEXT MOVE 

? 3, 2, 2 

NEXT MOVE 

? 3, 2, 3 

NEXT MOVE 

7 3, 2S2S3, 3 

CONGRATULATIONS 

VOU NOW HAVE 600 DOLLARS 

DO VOU WANT TO TRY AGAIN ? 

? 1 

WANT TO MAKE A WAGER? 

? 1 ■ ■ 



DIAMND 



PRINTS DIAMOND PATTERN 



Description 



This program fills an 8%xll piece of paper with diamonds (plotted 
on a hard-copy terminal, of course) . The program asks for an 
odd number to be input in the range 5 to 31. The diamonds printed 
will be this number of characters high and wide. The number of 
diamonds across the page will vary from 12 for 5-character wide 
diamonds to 1 for a diamond 3 1-characters wide. 

Program Author 

Digital Equipment Corp. 
Maynard, MA 01754 




87 



PROGRAM LISTING 



SAMPLE RUN 



3 PRINT "FOR fl PRETTY DIAMOND PATTERN," 

4 PRINT "TVPE IN AN ODD NUMBER BETWEEN 5 AND 31. 

5 input rsprint 

6 q=int<:s@/r:j 

8 FOR L=l TO Q 

18 X=1\Y=R\Z=2 

28 FOR N = X TO V STEP Z 

25 PRINT TRB<<R-N>/2); 

28 FOR M = l TO Q. 

29 C = l 

38 FOR R = l TO N 

31 IF C = l THEN 40 

32 IF C=2 THEN 42 

33 IF C = 3 THEN 44 
35 



FOR A PRETTV DIAMOND PATTERN, 

TVPE IN AN ODD NUMBER BETWEEN 5 AND 31. 

? 15 



\GOTO 58 
SQOTO 47 
SGOTO 4? 



PRINT " ! 

PRINT "D 

PRINT "E 

PRINT "C"; 

OC + 1. 

NEXT A 

IF H-Q THEN 60 

PRINT TrtB<R*M+<: 

NEXT M 

PRINT 

NEXT N 

IF KOI THEN 95 

X=R~2\Y=l\Z=-2 

GOTO 28 

NEXT L 

END 



D - 
DEC 
DEC ! 
DEC! 
DEC! 
DEC! 
DEC! ! 
DEC ! ! ! 
DEC! ! 
DEC! 
DEC! 
DEC! 
DEC ! 
DEC 
D 
D 
DEC 
DEC! 
DEC! 
DEC! 
DEC! 
DEC! ! 
DEC! !'! 
DEC! ! 
DEC! 
DEC! 
DEC! 
DEC! 
DEC 
D 
D 
DEC 
DEC! 
DEC! 
DEC) 
DEC) 
DEC! ! 
DEC ! ! ! 
DEC! ! 
DEC! 
DEC ! 
DEC! 
DEC » 
DEC 
D 
D 
DEC 
DEC ! 
DEC! 
DEC! 
DEC! 
DEC! ! 
DEC! ! ! 
DEC ! I 
DEC! 
DEC! 
DEC! 
DEC! 
DEC 
D 

READY 



D 
DEC 
DEC! 
DEC! 
DEC! 
DEC! 
DEC! ! 
! DEC ! ! ! 
DEC! ! 
DEC! 
DEC! 
DEC ! 
DEC! 
DEC 
D 
D 
DEC 
DEC! 
. DEC ! 
DEC! 
DEC ! ! 
DEC! ! ! 
!DEC! ! ! ! 
DEC! ! ! 
DEC ! ! 
DEC ! 
DEC ! 
DEC! 
DEC 
D 
D 
DEC 
DEC! 
DEC ! 
DEC! 
DEC! ! 
DEC ! ! ! 
!DEC! ! ! ! 
DEC! ! ! 
DEC! ! 
DEC! 
DEC! 
DEC) 
DEC 
D 
D 
DEC 
DEC ! 
DEC) 
DEC ! 
DEC! ! 
DEC! ! ! 
.'DEC! ! ! ! 
DEC! ! ! 
DEC! ! 
DEC! 
DEC! 
DEC! 
DEC 
D 



D 
DEC 
DEC ! 
DEC! 
DEC ! 
DEC ! ! 
DEC ! ! ! 
! DEC ! ! ! ! 
DEC ! ! ! 
DEC ! ! 
DEC ! 
DEC) 
DEC ! 
DEC 
D 
D 
DEC 
DEC! 
DEC) 
DEC ! 
DEC ! ! 
DEC ! ! ! 
!DEC! ! ! ! 
DEC! ! ! 
DEC! ! 
DEC ! 
DEC! 
DEC! 
DEC 
D 
D 
DEC 
DEC ! 
DEC ! 
DEC ! ! 
DEC) ) ) 
DEC! ! ! ! 
!DEC! ! ! ! ! 
DEC ! ! ! ! 
DEC ! ! ! 
DEC! ! 
DEC! 
DEC) 
DEC 
D 
D 
DEC- 
DEC i 
DEC ! 
DEC!! 
DEC! ! ! 
DEC ! ! ! ! 
!DEC! ! ! ! ! 
DEC! ! ! ! 
DEC ! ! ! 
DEC! ! 
DEC! 
DEC ! 
DEC 
D 



D 
DEC 
DEC! 
DEC ! ! 
DEC ! ! ) 
DEC ) ! ! ! 
! DEC ! ! ! ! i 
! ! DEC !!!!!! 
! DEC ! ! ! ! ! 
DEC ! ! ! ! 
DEC ! ! ! 
DEC! ! 
DEC ! 
DEC 
D 
D 
DEC- 
DEC! 
DEC ! ) 
DEC ! i ! 
DEC! 
! DEC!! 
! .'DEC! ! ! 
! DEC ! ! 
DEC ! 
DEC ! ! ! 
DEC ! ! 
DEC! 
DEC 
D 
D 
DEC 
DEC! 
DEC! ! 
DEC ! ! ! 
DEC!!)! 
! DEC ! ! ! ! ! 
! ! DEC !!!!!! 
! DEC ! ! ! ! ! 
DEC! ) ! ! 
DEC ! ! ! 
DEC ! ! 
DEC) 
DEC 
D 
D 
' DEC 
DEC ! ! 
DEC ! ! 
DEC! ! ! 
DEC ! ! ! ! 
! DEC ! ! ! ! ! 
! ) DEC !!!!!) 
! DEC! ! ! ! ! 
DEC! ! ! ! 
DEC! ! ! 
DEC! ! 
DEC! 
DEC 
D 



88 



DICE 



SIMULATES ROLLING TWO DICE 



Description 



Not exactly a game, this program simulates rolling a pair of 
dice a large number of times and prints out the frequency dis- 
tribution. You simply input the number of rolls. It is in- 
teresting to see how many rolls are necessary to approach the 
theoretical distribution: 



2 
3 
4 



1/36 
2/36 
3/36 



2.7777...% 
5.5555...% 
8 • 3333 • • • % 



etc. 



Program Author 



The author of this program is in the seventh grade at Harrison 
Junior-Senior High School. 

Daniel Freidus 
Park Drive South 
Rye, Ti 10580 




PROGRAM LISTING 



SAMPLE RUN 



THE ROLLING OF 



DIM F <12> 

REM DANNV FREIDUS 

PRINT "THIS PROGRAM 
"PAIR OF DICE. 

"VOL! ENTER THE NUMBER OF TIMES VOU WANT THE COMPUTER" 
"TO -ROLL-- THE DICE. WRTCH OUT, VERV LARGE NUMBERS TAKE" 
"A LONG TIME, IN PARTICULAR, NUMBERS OVER 50*0 " 
1 TO 12 



IMULATE 
40 PRINT 
50 PRINT 
60 PRINT 
7@ PRINT 
86 FOR Q: 
90 „F<G> = 
100 NEXT Q. 

110 PRINTSPRINT "HOW MANV ROLLS" 
128 INPUT X 
130 FOR S=l TO X 
140 R=INT<6+RND+1> 
150 B=INT<6*RND+1) 
160 R = A + B 
170 F';R>=F<R>+1 
18Q NEXT S 
185 PRINT 

190 PRINT "TOTAL SPOTS 
200 FOR V=2 TO 12 
218 PRINT V, F(V) 
220 NEXT V 

222 PRINTSPRINT "TRV AGAIN 

223 INPUT 7.t 

224 IF Z*="VES" THEN SO 
240 END 



NUMBER OF TIMES" 



THIS PROGRAM SIMULATES THE ROLLING OF A 

PAIR OF DICE. 

VOU ENTER THE NUMBER OF TIMES VOU WANT THE COMPUTER 

TO -'ROLL'- THE DICE. WRTCH OUT, VERV LARGE NUMBERS TAKE 

A LONG TIME, IN PARTICULAR, NUMBERS OVER 5000. 

HOW MANV ROLLS? 5000 

TOTAL SPOTS NUMBER OF TIMES 



9 

10 

11 
12 



140 
285 
410 
539 
702 
826 
691 
552 
428 
288 
139 



TRV AGAIN? VES 
HOW MANV ROLLS? 



TOTAL 


SPOTS 


NUMBER OF TIMES 


2 




273 


3 




557 


4 




846 


5 




1121 


6 




1383 


7 




1670 


3 




1398 


9 




1103 


1Q : 




821 : 


11 




547 


12 




281 



TRV AGAIN? VES 

HOW MANV ROLLS? 100 

TOTAL SPOTS NUMBER OF TIMES 

2 5 

3 7 

4 7 

5 10 

6 10 

7 22 



9 










13 


10 










9 


11 










4 


12 










4 ■ 


TRV 


AGAIN 


? 


VES 




HOW 


MANV 


ROLLS 


? 1000 


TOTAL 


SPOTS 




NUMBER OF TIME 


2- 










35 


3 










51 


4 










78 


5 










112 


6 










130 


7 










168 


8 










139 . 


9 










115 :■■■ . 


10 










85 



12 
TRV AGAIN? NO 
READV ; 



90 



DIGITS 



COMPUTER TRIES TO OUTGUESS PLAYER 



Description 



The player writes down a set of 30 numbers (0, 1, or 2) at random 
prior to playing the game. The computer program, using pattern 
recognition techniques, attempts to guess the next number in 
the input. 

The computer asks for 10 numbers at a time. It always guesses 
first and then examines the next number to see if it guessed 
correctly. By pure luck (or chance or probability), the com- 
puter ought to be right 10 times. It is uncanny how much better 
it generally does than that! 

Source 

Keiwit Computation Center 
Dartmouth College 
Hanover, NH 03755 




91 



PROGRAM LISTING 



SAMPLE RUN 



210 PRINT "THIS IS A GAME OF GUESSING," 

220 PRINT "FOR INSTRUCTIONS, TYPE '!'# ELSE TYPE ■ ' «• I 

230 INPUT E 

240 IF E«0 THEN 360 

250 PRINT 

260 PRINT "PLEASE TAKE A PIECE OF PAPER AND WRITE DOWN" 

270 PRINT "THE DIGITS »0", •!', OR «2» THIRTY TIMES AT RANDOM," 

280 PRINT "ARRANGE THEM IN THREE LINES OF TEN DIGITS," 

290 PRINT "I WILL ASK FOR THEM 10 AT A TIME," 

300 PRINT "I WILL ALWAYS GUESS FIRST, AND THEN LOOK AT YOUR" 

310 PRINT "NEXT NUMBER TO SEE IF I WAS RIGHT, BY PURE LUCK I" 

320 PRINT "pUGHT TO 8E RIGHT 10 TIMES, BUT I HOPE TO DO BETTER" 

330 PRINT "THAN THAT ****" 

340 PRInT\PRINT 

360 READ A,8,C 

370 DATA 0,1,3 

380 DIM M(26,2), K(2,2), L(8,2) 

400 MAT M«CON\MAT K»CON 

420 MAT K«C9)*K\MAT L»CON 

440 MAT L"(3)*L 

450 L(0,0)»2\LC4,l)"2\L(8,2)«2 

480 Z«26\Z1*6\Z2»2 

510 X»0 

520 FOR T«l TO 3 

530 PRINT 

540 PRINT "TEN NUMBERS PLEASE"! 

550 INPUT Nfl),N(2),N(3),NC4),N(5),N(6),N(7),N(8),N(9),N(10) 

560 FOR I»l TO 10 

570 W«N(I)-1 

580 IF WaSGN(W) THEN 620 

590 PRINT "USE ONLY THE DIGITS "0», '1', OR »2«." 

600 PRINT "LET'S TRY AGAIN, "\GOTO 530 

620 NEXT I 

630 PRINT\PRINT "MY GUESS" , "YOUR NO, ", "RESULT" , "MO, RIGHT"\PRINT 

660 FOR UM TO 10 

670 N*N(u)\S»0 

690 FOR Ja0 TO 2 

700 S1*A*K(Z2,J)+B*L(Z1,J)+C*MCZ,J) 

710 IF S>S1 THEN 760 

720 IF S<S1 THEN 740 

730 IF RND<,5 THEN 760 

740 S«S1\G«J 

760 NEXT J 

77B PRINT G,N(U), 

780 IF G*N(U) THEN 810 

790 PRINT "WRONG", X 

800 GOTO 880 

810 X*X + 1 

820 PRINT "RIGHT", X 

830 M(Z,N)«M(Z,N)+1 

840 L(Z1,N)»L(Z1»N)+1 

850 K(Z2,N)»K(Z2#N)+1 

860 Z«Z-lNT(Z/9)*9 

870 Z»3*Z*NfU) 

880 Zl»Z-INT(Z/9)*9 

890 Z2*N(U) 

900 NEXT U 

910 NEXT T 

920 PRINT 

930 IF X>10 THEN 980 

940 IF X<10 THEN 1010 

950 PRINT "I GUESSED EXACTLY 1/3 OF YOUR NUMBERS," 

960 PRINT "IT IS A TIE GAME," 

970 GOTO 1030 

980 PRINT "I GUESSED MORE THAN 1/3 OF YOUR NUMBERS," 

990 PRINT "I KlN."\FOR Q«l TO 10VPRINT CHR$(7) I \NEXT Q 

1000 GOTO 1030 

1010 PRINT "I GUESSED LESS THAN 1/3 OF YOUR NUMBERS," 

1020 PRINT "YOU BEAT. me. CONGRATULATIONS ****" 

1030 PRINT 

1040 PRINT "DO YOU WANT TO TRY AGAIN (1 FOR YES, FOR NO)"; 

1060 INPUT X 

1070 IF x«l THEN 400 

1080 PRIN7APRINT "THANKS FOR THE GAME," 

1090 END 



THIS IS fl GAME OF GUESSING. 
FOR INSTRUCTIONS, TVPE ' l 1 ' , 



ELSE TVPE '0'? 1 



PLEASE TAKE fl PIECE OF PAPER AND WRITE DOWN 

THE DIGITS ''O'/rl'', OR '2-' THIRTY TIMES AT RANDOM. 

ARRANGE THEM IN THREE LINES OF TEN DIGITS. 

I WILL ASK FOR THEM 10 AT A TIME. 

I WILL ALWAYS GUESS FIRST, AND THEN LOOK AT VOUR 

NEXT NUMBER TO SEE IF I WAS RIGHT. BV PURE LUCK I 

OUGHT TO BE RIGHT 10 TIMES. BUT I HOPE TO DO BETTER 

THAN THAT *+** 



TEN NUMBERS PLEASE? 1, O, 2, 0, 2, 1, 1, 1, 2, 6 



MY GUESS 


YOUR 


NO. 


RESULT 


NO. 


1 


1 




RIGHT 


1 


2 







WRONG 


1 


1 


2 




WRONG 


1 


2 







WRONG 


1 


2 


2 




RIGHT 


2 


1 


1 




RIGHT 


2 


2 


1 




WRONG 


;<: 


2 


1 




WRONG 


1. 


2 


2 




RIGHT 


4 


1 


• 




WRONG 


4 


TEN NUMBERS 


PLEASE? O, 1, 


: :, 0,1, 2, 0, 1, 2,0 


MY GUESS 


YOUR 


NO. 


RESULT 


NO. 


1 







WRONG- 


4 


:l 


1 




RIGHT 


■5 


2 


2 




RIGHT 


6 


1 







WRONG 


6 


:1 


i 




RIGHT 


7' 


2 


2 




RIGHT 


* 


i 







WRONG- 


y 


l 


1 




RIGHT 


9 


2 


2 




RIGHT 


10 


i 







WRONG 


10 


TEN NUMBERS 


PLEASE? 1, i, 1, 1, 1, 1, 2, 2, 2, : 




MY GUESS 


YOUR 


NO. 


RESULT 


NO. 


1 


1 




RIGHT 


1:1. 


2 


1 




WRONG 


11 


2 


1 




WRONG 


11 


2 


1 




WRONG- 


11 


2 


1 




WRONG 


11 


2 


1 




WRONG 


11 


2 


2 




RIGHT 


12 


1 


2 




WRONG 


12 


■1 


2 




WRONG 


12 


1 


2 




WRONG- 


12 



I GUESSED MORE THAN 1/3 OF YOUR NUMBERS. 
I WIN. 

DO YOU WANT TO TRY AGAIN <1 FOR YES, © FOR NO)? 1 

TEN NUMBERS PLEASE? 1,1,1,1,1,1,2,2,2,2 

MY GUESS VOUR NO. RESULT NO. RIGHT 

1 1 RIGHT 1 

2 1 WRONG 1 

1 1 RIGHT 2 

2 1 WRONG 2 
2 1 WRONG 2 
2 1 WRONG 2 
2 2 RIGHT 3: 
2 2 RIGHT 4 
1 2 WRONG 4 
1 2 WRONG 4 



TEN NUMBERS PLEASE? 0,0,0,0,0,0,2,2,2,2 

MY GUESS YOUR NO. RESULT NO. RIGHT 



1 









WRONG 


1 









WRONG 


1 









WRONG 


:1 









WRONG 


1 









WRONG- 


1 









WRONG 


1 


2 






WRONG 


1 


2 






WRONG 


1 


2 






WRONG- 


1 


2 






WRONG 


TEN NUMBERS 


PLEASE? 


0, 2. 


0, 2 


. 0, 20, 0, 2, 


? 2 










USE ONLY THE 


DIGITS 


'0'. 


'1 


x , OR '2'. 


LET'S TRY AGAIN. 








TEN NUMBERS 


PLEASE? 


0, 2 


O, 2 


. 0, 2, O, 2, 0, 


MY GUESS 


VOUR 


NO. 




RESULT 


1 









WRONG 


1 


2 






WRONG 


1 









WRONG- 


1 


2 






WRONG 


.1 









WRONG 


1 


2 






WRONG 


1 









WRONG- 


1 


2 






WRONG 


1 









WRONG 


1 


2 






WRONG 



NO. RIGHT 



I GUESSED LESS THAN 1/2 OF VOUR NUMBERS. 
YOU BEAT ME. CONGRATULATIONS **** 



92 



DO YOU WANT TO TRY AGAIN <1 FOR VES, FOR NO)? 
THANKS FOR THE GAME. 



DOGS 



__ _ DOG RACE 

Description 

This is a dog race game similar to those found in penny arcades 
and amusement parks. The prior racing experience of each dog 
(wins and losses) has a bearing on the outcome of the race. 
After this is posted, up to 19 players may bet on a dog. 
Maximum bet is $500.00 and minimum is $2.00. 

After all the bets are in, the odds will be posted and the race 
begins! After each days ' s racing, the track will close and 
record the performance of all the dogs in a permanent file 
which is called the next time the program is run. 

Computer Limitations 

DOGS was written for a DIGITAL EduSystem 50 (Timeshared-8) ; 
consequently, the file handling routine (Lines 25, 30, 35, 55, 
975, 985, 1085) may have to be changed for other systems. 

Program Author 

The author remarks that he is now 15 and started using a PDP-8 
at the age of 12. Since then he has compiled 4 notebooks of 
programs in BASIC, FOCAL, FORTRAN, and ALGOL. Of his 23 BASIC 
games, 5 are published in this book. 

Victor Nahigian 
39 Beaver Road 
Weston, MA 02193 



93 



PROGRAM- LISTING 



5 REM V.NAHIGIAN 8TH GRADE DOG RACE GAME 

10 DIM SC10),CC10),J(20),W(i0),AC10) 

15 DIM N$(20),H$(10),P(20) 

20 DIM Y(10),BCU),M5(20) 

2S RECORD V 

30 RECORD X 

35 OPEN 8,"WINS«\0PEN 9, "LOSSES" 

40 IF 39*6 THEN 70VFOR 1*1 TO 10VGET 8,25,I\V9*V9*V\N£XT I 

45 IF V9<25 THEN 60\IF V9>200 THEN 55 

50 GOTO 100 

55 UNSAVE 8\UNSAVfc 9 

60 PRINT "PLEASE WAIT, DISREGARD THE 25 BELLS" 

65 PRINT\PRINT\PRINT\PRINT\PRINT\S9«6\G0T0 35 

70 FOR 1*1 TO 26-V9\RANDOMlZE\M*INT(i0*RND(X))+i\GET 8,25,H 

75 V*V+1\PUT 8,25,H\F0R T*l TO 10\IF H«T THEN 85 

80 GET 9,30,T\X*X+1\PUT 9,30,T 

85 NEXT T 

90 PRINT CHRSC 135) ; 

95 NEXT I 

100 PRINT\PRINT\PRINT 

105 PRINT TABC10) J"WELCQME TO ROQK-A-DAY RACE TRACKU1" " 

110 PRINT\PRIMT 

115 PRINT' "DO YOU WANT THE INSTRUCTIONS" ; \INPUT I$\60T0 215 

120 PRINT h THIS IS A DOG RACE GAME, THERE ARE 10 DOGS" 

125 PRINT "WHICH RUN IN THIS RACE, THE WINS AND LOSSES OF" 

130 PRINT "EACH DOG ARE RECORDED SO THAT EVEN AFTER YOU" 

135 PRINT "LOG-OFF, THE WINS AND LOSSES OF THE DOGS WILL STILL" 

140 PRINT "BE RECORDED," 

145 PRINT " THE WINNER OF THE RACE WILL BE OETERMENED BY HOW" 

150 PRINT "MANY WINS AND LOSSES EACH DOG HAS, AFTER THE WINS AND" 

155PRINT "LOSSES OF EACH DOG HAVE BEEN POSTED, YOU WILL HAVE A " 

160 PRINT "CHANCE TO BET, NO MORE THAN 19 PEOPLE ARE ALLOWED" 

165 PRINT "TO BET IN THIS GAME, WHEN BETTING, YOU CANNOT BET OVER" 

170 PRINT "$500,00 AND MUST BET AT LEAST $2,00, MORE THAN 1" 

175 PRINT "PERSON MAY BET ON THE SAME DOG, AFTER THE BETS" 

180 PRINT "ARE MADE THE ODDS WILL BE FIGURED AND POSTED AND THE " 

185 PRINT "RACE WILL BEGIN," 

190 PRINT " THE STRADGY OF THIS GAME IS TO PICK THE WINNER" 

195 PRINT " INSUCH A WAY THAT THE ODDS ON THAT DOG ARE GOOD" 

200 PRINT "IN YOUR FAVOR." 

210 PRINTSPRINT TAB(10)I"GOOD LUCKl|"'\COTO 220 

215 IF I$*"YES" THEN 120NGQTO 220 

220 GOSUB 225\G0T0 255 

225 PRINT\PRINT\PRINT "DOG" , "NUMBER", "WINS" , "LOSSES" 

230 FOR 1*1 TO 10 

235 READ HSXI) 

240 GET 8,25,I\GET 9,30,1 

245 PRINT H$m,T,V,X 

250 NEXT I\RETURN 

255 PRINT\PRINT\PRINT "HOW MANY WISH TO BET"! 

260 INPUT GAIF Q<20 THEN 270 

265 PRINT "NO MORE THAN. 19 ALLOWED»\PRINT\GOTQ 255 

270 FOR Z«l TO Q 

275 PRINT "BETTOR'S NA*E" > UNPIJT N$(Z) 

280 PRINT "DOG'S NUMBER" ; \INPUT J(Z) 

285 PRINT "AND YOUR BET»»\INPUT P(Z) 

290 IF P(Z)<2 THEN 300MF P(Z)>500 THEN 315 

295 PRINTVNEXT ZVGOTQ 325 

300 PRINT "YOU MUST BET AT LEAST $2,00, TRY AGAIN "N$(Z) 

305 PRINT "YOUR BET»l\lNPuT P(Z) 

310 GOTO 290 

315 PRINT "YOU CAN'T BET OVER 500,00 "N$(Z3" TRY AGAIN" 

320 GOTO 305 

325 FOR 1*1 TO 10 

330 BCll)»B(li)+P(I) 

335 NEXT I 

340 FOR 1*1 TO Q 'AMOUNT OF PEOPLE PLAYING 

345 FOR 13*1 TO 10'DOGS 

350 IF JCI)<>I3 THEN 360 

355 A(I3)»A(I3)+P(I) 

360 NEXT 13 

365 NEXT I 

370 FOR 1*1 TO 1.0 

375 IF , A(I)>«2 THEN 390 

380 B(I)«INT(b(ll)*RND(X))+l 

385 GOTO 395 

390 BCl)»INTUBCll}-ACI))/(ACI)*e.l7*ACI))n 

395 IF B(I)<*2 THEN 405 

400 GOTO 410 

405 B(I) "2 

410 NEXT I 

415 PRINT ',::•; " . 

420 PRINj "DOG", "NUMBER", "ODDS" 

425 FOR 1*1 TO 10 

430 PRlhT H|(l),I ( B(I)»l i" 

435 NEXT I 

440 FOR I*! TO 10 

445 GET 8,25,I\GET 9,30, IMF V*X<*0 THEN 470 

450 RANDOMIZE 

455 Y(I)«INT(V/ABS((V+X))+INT(V*RND(X))*1) 

460 IF YCI)<7 THEN 47^i 

465 GOTO 475 

470 Y(I)*INTC7*RND(X))+1 

475 NEXT I , ' .. 

480 FOR R*i TO 10 

485 S(R)«0 

490 NEXT R 

495 PRINT 

500 PRINT TAB(2)I"«1 2 3 4 5 6 7 8 9 10", "AND THEY'RE OFFili" 

505 PRINT CHR$(135)?CHR$(135)|CHR$(135)ICHR$(135)ICHR$(135)| 

510 FOR R«l TO 10 

515 RANDOMIZE 

520 C(R)*InT(Y(R)*RnD(X))+1 

525 3(.R)«S(P)+C(R) 

530 NEXT R 

535 PRINT TAB(2)|"XXXXXXXXSTARTXXXXXXXX" 

540 FOR P«i TO 20 

545 FOR R«i TO 10 

550 IF P*S(R) THEN 580 



555 IF SCR)>20 THEN 590 

560 NEXT R 

565 PRINT 

570 NEXT P 

575 GOTO 625 

580 PRINT TABCR*2)JRJCHR$(141) 

585 GOTO 560 

590 IF W(1)<>0 THEN 605 

595 WCD*R 

600 GOTO 560 

605 0*2 

610 W(D)*R 

615 D*D+1 

620 GOTO 560 

625 IF W(i)<>0 THEN 640 

630 PRINT TA8C2) J"XXXXXXXFINISHXXXXXXXX" 

635 GOTO 510 

640 FOR Y*2 TO 22 

645 PRINT TABCY)|"X"lTAB(Y)lCHR$fl35)| 

650 IF Y*7 THEN 665 

655 NEXT Y 

660 GOTO 680 

665 PRINT " FINISH"! 

670 Y«13 

675 GOTO 655 

680 PRINT 

685 PRINT » "I . .. 

690 FOR 1*2 TO 22\PRlNT «*";\NEXT SPRINT 

695 IF D<*1 THEN 735 

700 G«W(1) 

705 FOR 12*1 TO D 

710 IK S(WfI2))<SCWCI2+in THEN 725 

715 NEXT 12 

720 GOTO 735 

725 G«W(I2+1) 

730 GOTO 715 

735 PRINT 

740 PRINT 

745 PRINT "AND THE WINNER IS DOG NUMBER" » G, H$ (G) 

750 PRINTVGOTO 970 

755 RESTORE 

760 FOR E*l TO Q 

765 IF G«J,CE) THEN 790 

770 M5(E)*M5ffc)-P(E) 

775 N7*N7+P(E) 

780 NEXT E 

785 GOTO 835 

790 IF B(G)*2 THEN 800 

795 GOTO 805 

800 B(G)*1 

805 M*INTC100*(B(G)*P(E)*P(E))/100) 

810 PRINT "CONGRATULATION "N$(£)" YOU HAVE WON $"?M 

815 M5(E)*M5(E)+M 

820 N7*N7-M 

825 PRINT 

830 GOTO 780 

835 PRINT "WOULD YOU AVID RACE FANS LIKE TO PLAY AGAIN"? 

840 INPUT L$ 

845 IF L$*"YES" THEN 870 

850 PRINT\PRINT "PERSON", "AMOUNT "\FOR 1*1 TO Q 

855 PRINT N$(I),M5Cn\NEXT IVPRINT "C0MP«,N7 

860 FOR 1*1 TQ 5\PRINT\NEXT INGOTO 1085 ■ ■ ' ■ 

865 GOTO 1085 

870 FOR K*l TO 10 

875 A(K)»0 

880 S(K)*0 

885 W(K)b0 

890 C(K)b0 

895 J(K)*0 

900 B(11)«0 

905 BCK)*0 

910 NEXT KNGOSUB 225 

915 PRINT "ANY NEWCOMERS" ; VINPUT C$ 

920 FOR 1*1 TO. Q 

925 PR TNT N$CI>" YOUR DOGS NUMBER" l\ INPUT J(I) 

930 PRINT "AND YOUR BET"J\'lNPUT P(I) 

935 IF PCIX2 THEN 950\IF P(I)>500 THEN 960VNEXT I 

940 IF C$*"NO" THEN 325 

945 GOTO 1025 

950 PRINT "YOU MUST BET AT LEAST $2,00 "N$(I) '• YOUR BET"! 

955 INPUT PCDSGOTO 935 

960 PRINT "YOU CAN'T BET OVER $500,00 "N$(I)" TRY AGAIN" 

965 GOTO 930 

970 FOR 1*1 TO 10 

975 SET 8,25,I\GET 9,30,1 

980 IF I*G THEN;: 995 

985 rXiX+lvV PUT 9,30,1 

990; -GO TO 1000 

995 V*V+1VPUT 8,25,1 

1000 NEXT T 

1005 GOTO 755 

1010 DATA "FASTER ","ZELD A", "SPEEDY", "ZIFFLE", "KILLER" 

1015 DATA "BURBON","BUGZY«, "SNOOPY", "LASSIE", ' 'WINNER" 

1020 GOTO 1085 

1025 PRINTVPRINT "HOW MANY NEWCOMERS" I \Q4»0\INPUT J6\Q4sQ+J6 

1030 IF O4>20 THEN 1035\Q*Q4\Q4*0\GO TO 1040 

1035 PRINT "NO MORE THAN 19 ALLOWED, YOU U NOW HAVE "Q\Q4*0\GOTO 1025 

1040 FOR Zp"I TO 

1045 PRINT "BETTORS NAM£"|\INPUT N*(Z) 

1050 PRINT "DOGS NUMBER»f\lNPUT J(Z) 

1055 PRINT "AND YOUR BET"!\INPUT P(Z)\IF P(Z)<2 THEN 1070 

1060 IF P(Z)>500 THEN 1075 

1065 PRINT\NEXT ZNGOTO 325 

1070 PRINT "YOU MUST BET AT LEAST $2.00"\GOTO 1055 

1075 PRINT "YOu CAN'T BET OVER $500,00"\GOTO 1055 

1080 GOTO 325 

1085 CLOSE 8\CL0SE 9 

1090 REM 

1095 END 



94 



SAMPLE RUN 

WELCOME TO ROOK-A-DAY RACE TRACK!!! 



XXXXXXXXSTARTXXXXXXXX 



DO YOU WANT THE INSTRUCTIONS? YES 

THIS IS A DOG RACE GAME. THERE ARE 10 DOGS 
WHICH RUN IN THIS RACE. THE WINS AND LOSSES OF 
EACH DOG ARE RECORDED SO THAT EVEN AFTER YOU 

LOG -OFF, THE WINS AND LOSSES OF THE DOGS WILL STILL 
BE RECORDED. 

THE WINNER OF THE RACE WILL BE DETERMENED BY HOW 
M*NY WINS AND LOSSES EACH DOG HAS. AFTER THE WINS AND 
LOSSES OF EACH DOG HAVE BEEN POSTED, YOU WILL HAWE A 
CHANCE TO BET. NO MORE THAN 19 PEOPLE ARE ALLOWED 
TO BET IN THIS GAME. WHEN BETTING* YOU CANNOT BET OVER 
S500.00 AND MUST BET AT LEAST S2.00. MORE THAN 1 
PERSON MAY BET ON THE SAME DOG. AFTER THE BETS 
ARE MADE THE ODDS W ILL BE FIGURED AND POSTED AND THE 
RACE WILL BEGIN. 

THE STRADGY OF THIS GAME IS TO PICK THE WINNER 
INSUCH A WAY THAT THE ODDS ON THAT DOG ARE GOOD 
IN YOUR FAVOR. 





GOOD LUCK!! 






DOG 


NUMBER 


WINS 


LOSSES 


FASTER 


1 


4 


21 


ZELDA 


2 


4 


21 


SPEEDY 


3 


7 


18 


ZIFFLE 


4 


1 


24 


KILLER 


5 





25 


BURBON 


6 


1 


24 


SUGZY 


7 


4 


21 


SNOOPY 


8 


4 


21 


LASSIE 


9 





25 


WINNER 


10 





25 



XXXXXXXF INISHXXXXXXXX 
XXXXXXXXSTARTXXXXXXXX 



HOW MANY WISH TO BET? 7 
BETTOR'S NAME? BOB 
DOG'S NUMBER? 1 
AND YOUR BET? 400 

BETTOR'S NAME? STUART 
DOG'S NUMBER? 3 
AND YOUR BET? 50 

BETTOR'S NAME? VIC 
DOG'S NUMBER? 10 
AND YOUR BET? 100 

BETTOR'S NAME? JOHN 
DOG'S NUMBER? 8 
AND YOUR BET? 120 

BETTOR'S NAME? ROBERT 
DOG'S NUMBER? 5 
AND YOUR BET? 69 

BETTOR'S NAME? ED 
DOG'S NUMBER? 9 
AND YOUR BET? 500 

BETTOR'S NAME? TOM 

DOG'S NUMBER? 2 

AND YOUR BET? 600 

YOU CAN'T BET OVER 500.00 TOM TRY AGAIN 

YOUR BET? 1 

YOU MUST BET AT LEAST $2.00. TRY AGAIN TOM 

YOUR BET? 350 



XXXXXXXF IN IS HXXXXXXXX 
XXXXXXXXSTARTXXXXXXXX 



DOG 


NUMBER 


ODDS 


FASTER 


1 


3:1 


ZELDA 


2 


4 t 1 


SPEEDY 


3 


37 t I 


ZIFFLE 


4 


1 504 t 


KILLER 


5 


26 : 1 


BURBON 


6 


224 : 


BUGZY 


7 


719 : 


SNOOPY 


8 


14: 1 


LASSIE 


9 


2:1 


WINNER 


10 


17 : I 



-1 2 3 4 5 6 7 8 9 10 
XXXXXXXXS TARTXXXXXXXX 



AND THEY'RE OFF! ! ! 



XXXXXXF IN ISHXXXXXXXXX 

********************* 



AND THE WINNER IS DOG NUMBER 5 KILLER 

CONGRATULATION ROBERT YOU HAVE WON S 1863 



XXXXXXXF I N I S HXXXXXXXX 



95 



EVEN 



PICK UP AN EVEN NUMBER OF OBJECTS 



Description 



This is a game between you and the computer. To play, an odd 
number of objects (marbles, chips, matches) are placed in a row. 
You take turns with the computer picking up between one and four 
objects each turn. The game ends when there are no objects left, 
and the winner is the one with an even number of objects picked 
up. 

Two versions of this game are printed herein. While to the player 
they appear similar, the programming approach is quite different. 
EVEN, the first version, is deterministic — i.e., the computer 
plays by fixed, good rules and is impossible to beat if you don't 
know how to play the game. 

The second version, EVEN 1, is much more interesting because the 
computer starts out only knowing the rules of the game. Using 
simple techniques of artificial intelligence (cybernetics) , the 
computer gradually learns to play from its mistakes until it 
plays a very good game. After 20 games, the computer is a 
challenge to beat. Variation in the human's style of play seems 
to make the computer learn more quickly. If you plot the learn- 
ing curve of this program, it closely resembles classical human 
learning curves from psychological experiments. 

Program Authors 



EVEN: 


EVEN 1: 


Unknown 


Eric Peters 




Digital Equipment Corp 




Maynard, MA 01754 



4 



28 



12 



6 



8 



16 



34 



96 



TYPE A 1 IF YOU WANT TO GO FIRST, 
IF YOU WANT Mfc TO GO FIRST" 



EVEN PROGRAM LISTING 

1 LET Yi*0 

10 LET M1»0 
20 DIM M(20),YC20) 

30 PRINT" THIS IS A TWO-PERSON GAME CALLED 'EVEN WINS,'" 
40 PRINT"TO PLAY THE GAME, THE PLAYERS NEED 27 MARBLES OR" 
50 PRINT»OTHER OBJECTS ON A TABLE," 
60 PRINT 
70 PRINT 

80 PRINT" THE 2 PLAYERS ALTERNATE TURNS, WITH EACH PLAYER" 
90 PRINT»REMOVlNG FROM 1 TO 4 MARBLES ON EACH MOVE, THE GAME" 
100 PRINT"ENDS WHEN THERE ARE NO MARBLES LEFT, AND THE WINNER" 
110 PRINT"IS THE ONE WITH AN EVEN NUMBER OF MARBLES," 
120 PRINT 
130 PRINT 

140 PRINT" THE ONLY RULES ARE THAT CD YOU MUST ALTERNATE TURNS, 
150 PRINT" (2) YOU MUST TAKE BETWEEN 1 AND 4 MARBLES EACH TURN," 
160 PRINT«AND (3) YOU CANNOT SKiP A TURN," 
170 PRINT 
160 PRINT 
190 PRINT 

200 PRINT" TYPE A 1 IF YOU WANT TO GO FIRST, AND TYpE" 
210 PRINT«A 
220 INPUT C 
230 IF C«0 THEN 250 
240 GOTO 1060 
250 LETT-27 
260 LET Ms2 
270 PRINT»T0TAL = "}T 
280 LET M1=M1+M 
290 .LET TaT-M 

300 PRINT "I PICK UP»fM>'» MARBLES," 
310 IF T*0 THEN 880 
320 PRINT"TOTAL = ">T 
330 PRINT"" 

340 PRINT" AND WHAT IS YOUR NEXT MOVE, MY TOTAL IS"»M1 
350 INPUT Y 
360 PRINT"" 
370 IF Y<1 THEN 1160 
380 IF Y>4 THEN 1160 
390 IF Y<*T THEN 430 

400 PRINT" YOU HAVE TRIED TO TAKE MORE MARBLES THAN THERE ARE" 
410 PRINT"LEFT, TRY AGAIN," 
420 GOTO 350 
430 LET YlsYl+Y 
440 LET T=T»Y 
450 IF T«0 THEN 880 
460 PRINT"TOTAL =">T 
470 PRINT"" 

480 PRINT" YOUR TOTAL IS ">Y1 
490 IF T<,5 THEN 880 
500 LET RaT-fe#INT(T/6) 
510 IF INT(Yl/2)=Yl/2 THEN 700 
520 IF T<4,2 THEN 580 
530 IF R>3.4 THEN 620 
540 LET M«R+1 
550 LET M1«M1+M 
560 LET TbT-M 
570 GO TO 300 
580 LET MAT 
590 LET T-T-M 
600 GO TO 830 

610 REM 250 IS WHERE I WIN, 
620 IF R<4,7 THEN 660 
630 IF R>3,5 THEN 660 
640 LET M=l 
650 GOTO 670 
660 LET M*4 
670 LET T*T-M 
680 LET MlsMl+M 
690 GOTO 300 

700 RE*J I AM READY TO ENCODE THE STRAT FOR WHEN OPP TOT IS EVEN, 
710 IF R<1,5 THEN 1020 
720 IF R>5,3 THEN 1020 
730 LET M*R-1 
740 LET M1=M1+M 
750 LET TaT-M 
760 IF t<,2 THEN 790 
770 REM IS « ZERO HERE 
780 GOTO 300 
790 REM IS a ZERO HERE 
800 PRINT"I PICK UP"fM|" MARBLES," 
810 PRINT"" 
820 GOTO 880 

830 REM THIS IS WHERE I WIN 
840 PRINT "I PICK UP"jMf" MARBLES," 
850 PRINT"" 
860 PRINT "TOTAL * 0" 
870 LET MleMl+M 

880 PRINT » THAT IS ALL OF THE MARBLES," 
8 90 PRINT"" 

900 PRINT" MY TOTAL IS"*M1»" YOUR TOTAL IS"?M 
910 PRINT"" 

920 IF INTCMl/2)*Ml/2 THEN 950 
930 PRINT" YOU WON, DO YOU WANT TO PLAY" 
940 GOTO 960 

950 PRINT" I WON, DO YOU WANT TO PLAY" 
960 PRINT«AGAIN? TYPE 1 FOR YES AND FOR NO," 
970 INPUT Al 
980 IF A1*0 THEN 1030 
990 LET M1»0 
1000 LET Y130 
1010 GOTO 200 
1020 GOTO 640 
1030 PRINT"" 
1040 PRINT" OK, 
1050 GOTO 1230 
1060 LET T a 27 
1070 PRINT 
1080 PRINT 
1090 PRINT 

1100 PRINT"TOTAL *">T 
1110 PRINT 
1120 PRINT 
1130 PRINT" 
1140 INPUT Y 
1150 GOTO 360 
1160 PRINT 
1170 PRINT" 

1180 PRINT"INTEGER BETWEEN 
1190 PRINT 

1200 PRINT" WHAT IS YOUR NEXT MOVE?" 
1210 PRINT 
1220 GOTO 350 
.1230 END 



SEE YOU LATER," 



WHAT IS YOUR FIRST MOVE?" 



SAMPLE RUN 

THIS IS A TWO-PERSON GAME CALLED 'EVEN WINS.' 
TO PLAY THE GAME, THE PLAYERS NEED 2? MARBLES OR 
OTHER OBJECTS ON A TABLE. 



THE 2 PLAYERS ALTERNATE TURNS, WITH EACH PLAVER 
REMOVING FROM 1 TO 4 MARBLES ON EACH MOVE. THE GAME 
ENDS WHEN THERE ARE NO MARBLES LEFT, AND THE WINNER 
IS THE ONE WITH AN EVEN NUMBER OF MARBLES. 



THE ONLY RULES ARE THAT <1> YOU MUST ALTERNATE TURNS, 
<2> YOU MUST TAKE BETWEEN 1 AND 4 MARBLES EACH TURN, 
™D <3> YOU CANNOT SKIP A TURN. 



TYPE A 1 IF YOU WANT TO GO FIRST, AND TYPE 
A 8 IF YOU WANT ME TO GO FIRST 
?1 



TOTAL a 2? 



WHAT IS YOUR FIRST MOVE? 
?1 

TOTAL = 26 

YOUR TOTAL IS 1 
I PICK UP 3 MARBLES. 
TOTAL * 23 

FIND WHAT IS YOUR NEXT MOVE, MY TOTAL .1 S 3 
?2 

TOTAL * 21 

YOUR TOTAL IS 3 
I PICK UP 4 MARBLES. 
TOTAL = 1? 

AND WHAT IS YOUR NEXT MOVE, MY TOTAL IS 7 
?2 

TOTAL = 15 

YOUR TOTAL IS 5 
I PICK UP 4 MARBLES. 
TOTAL = 11 

AND WHAT IS YOUR NEXT MOVE, MY TOTAL IS 11 
?1 

TOTAL = 1© 

YOUR TOTAL IS 6 
I PICK UP 3 MARBLES. 
TOTAL * ? 

AND WHAT IS YOUR NEXT MOVE, MY TOTAL IS 14 
?1 

Total * 6 

your total is 7 
i pick up 1 marbles. 

TOTAL = 5 

AND WHAT IS YOUR NEXT MOVE, MY TOTAL IS 15 
?3 

TOTAL = 2 

YOUR TOTAL IS 10 
I PICK UP 1 MARBLES. 
TOTAL = 1 

AND WHAT IS YOUR NEXT MOVE, MY TOTAL IS 16 



THAT IS ALL OF THE MARBLES. 

MY TOTAL IS 16 YOUR TOTAL IS 11 

T WON. DO YOU WANT TO PLAY 
AGAIN? TYPE 1 FOR YES AND & FOR NO. 
?1 



THE NUMBER OF MARBLES YOU TAKE MUST BE A POSITIVE" 
1 AND 4," 



97 



EVEN1 PROGRAM LISTING 



SAMPLE RUN 



& PRINT 

9 PRINT 

10 PRINT 

11 PRINT 

12 PRINT 
i:< PRINT 
14 PRINT 



PRINT "GAME OF EVEN WINS - CYBERNETIC VERSION" : PRINT 
INPUT "DO VOU WANT INSTRUCTIONS <! YES OR NO>";A$ 
IF R*="NO" THEN 19 
.PRINT-PRINT "THE GAME IS PLRVED RS FOLLOWS:" 
PRINT "RT THE BEGINNING OF R GAME, fi RANDOM NUMBER OF CHIPS ARE" 
PRINT "PLACED ON THE BOARD. THE NUMBER OF CHIPS ALWAYS STARTS" 
PRINT "AS AN ODD NUMBER. ON EACH TURN, A PLAYER MUST TAKE ONE, " 
"TWO, THREE, OR FOUR CHIPS. THE WINNER IS THE PLAYER WHO" 
"FINISHES WITH A TOTAL NUMBER OF CHIPS THAT IS EVEN. " 
"THE COMPUTER STARTS OUT KNOWING ONLY THE RULES OF THE" 
"GAME. IT GRADUALLY LERRNS TO PLfiV WELL. IT SHOULD BE" 
"DIFFICULT TO BEAT THE COMPUTER TWENTY GAMES IN A ROW. " 
"TRY IT! ! i " : PRINT 
"TO QUIT AT ANY TIME, TYPE ' 8' AS YOUR MOVE. ".PRINT 

20 DIM R<1,5> : RANDOMIZE 

25 L=O:E=0 

30 FOR I=0 TO 5 

40 R<1, I >=4 

50 R(0, I )=4 

60 NEXT I 

78 A=0:B=0 

90 F'= I NT < < 13+RND+9 > ,-'2 ) +2+1 

100 IF P=l THEN 530 

110 PRINT "THERE ARE "P "CHI PS ON THE BOARD. " 

120 E1=E 

120 L1=L 

140 EXft/2-INT(fl/2))*2 

150 L=INT<<P/6-INT':.P/fc">>*e+. 5> 

160 IF R<E, L>>=P THEN 228 

170 M=R<E,L> 

100 IF I1C=0 THEN 378 

190 p=p-M 

200 IF M=l THEN 518 

210 PRINT "COMPUTER TAKES "M"CHI PS LEfiVING"P" . . . YOUR MOVE"; 

220 B = B+M 

23:0 INPUT M 

240 M=INT<M> 

250 IF MCI THEN 450 

260 IF M>4 THEN 468 

278 IF M>P THEN 468 

200 IF M=P THEN 368 

298 P = P-M 

280 A=A+M 

210 GOTO 100 

328 IF P=l THEN 550 

220 PRINT "COMPUTER TAKES "P" CHI PS" 

240 R<E,L>-P 

350 B=B+P 

360 IF B/2=INT<B.-'2> THEN 428 

370 PRINT "GAME OVER ... VOU WIN !! "'PRINT 

390 IF R<E, L)=l THEN 488 

480 R<E,L>=R<E, L>-1 

418 GOTO 78 

428 PRINT "GAME OVER ... I WIN! !!": PRINT 
. 428 GOTO 78 

458 IF M=0 THEN 578 

468 PRINT M"IS FIN ILLEGAL MOVE 

470 GOTO 238 

400 IF R<E1,L1>=1 THEN 78 

490 R < El, LI > =R < El, LI > -1 

500 GOTO 70 

510 PRINT "COMPUTER TAKES 1 CHIP LEAVING 

520 GOTO 22© 

520 PRINT "THERE IS 1 CHIP ON THE BOARD" 

540 GOTO 120 

550 PRINT "COMPUTER TAKES 1 CHIP" 

560 GOTO 240 

578 END 

READY 



RUN 

EVEN1 85:54 PM 

GAME OF EVEN WINS 



29-JUN-72 
CYBERNETIC VERSION 



YOUR MOVE" 



YOUR MOVE" 



DO YOU WANT INSTRUCTIONS <YES OR NO>? YES 

THE GAME IS PLAYED AS FOLLOWS: 

AT THE BEGINNING OF A -GAME, A RANDOM NUMBER OF CHIPS ARE 
PLACED ON THE BOARD. THE NUMBER OF CHIPS ALWAYS STARTS 
AS AN ODD NUMBER. ON EACH TURN, A PLAYER MUST TAKE ONE, 
TWO, THREE, OR FOUR CHIPS. THE WINNER IS THE PLAYER WHO 
FINISHES WITH A TOTAL. NUMBER OF CHIPS THAT IS EVEN. 
THE COMPUTER STARTS OUT KNOWING ONLY THE RULES OF THE 
GAME. IT GRADUALLY LEARNS TO PLAY WELL. IT SHOULD BE 
DIFFICULT TO BEAT THE COMPUTER TWENTY GAMES IN A ROW. 
TRY IT! i ! 

TO QUIT AT ANY TIME, TYPE ' O' AS YOUR MOVE. 



THERE ARE 15 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 11 
THERE ARE 10 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 6 
THERE ARE 3 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS 
GAME OVER . . . YOU WIN! ! 

THERE ARE 21 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 19 
THERE ARE 17 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 13 
THERE ARE 9 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 7 
THERE ARE 6 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 2 
THERE IS 1 CHIP ON THE BOARD 
COMPUTER TAKES 1 CHIP 
GAME OVER . . . VOU WIN! ! 

THERE ARE 15 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 12 
THERE ARE 9 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 7 
THERE ARE 6 CHIPS ON THE BOARD. 
COMPUTER TAKES 3 CHIPS LEAVING 3 
GAME OVER . . . YOU WIN! ! 

THERE ARE 19 CHIPS ON THE BOARD. 
COMPUTER TAKES 1 CHIP LEAVING 19 
THERE ARE 16 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 12 
THERE ARE 8 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 4 
GAME OVER . . . VOU WIN! ! 

THERE ARE 11 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 7 
THERE ARE 6 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 4 
THERE IS 1 CHIP ON THE BOARD 
COMPUTER TAKES 1 CHIP 
GAME OVER . . . VOU WIN! ! 

THF I'E ARE 15 CHIPS ON THE BOARD. 
CO : 'UTER TAKES 2 CHIPS LEAVING 13 
ThcJ:E ARE 9 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 7 
THERE ARE 6 CHIPS ON THE BOARD. 
COMPUTER TAKES 1 CHIP LEAVING 5 . 
THERE ARE 4 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS 
GAME OVER . . . VOU WIN! ! 



. YOUR MOVE? 
YOUR MOVE? 



. . YOUR MOVE? 2 
....YOUR MOVE? 4 
. YOUR MOVE? 1 
. YOUR MOVE? 1 



. . YOUR MOVE? 4 
. YOUR MOVE? 1 
. YOUR MOVE? 3 

.-.YOUR MOVE? 2 
. . YOUR MOVE? 4 
. YOUR MOVE? 4 

. YOUR MOVE? 1 
.YOUR MOVE? 3 



. . . YOUR MOVE? 4 

. .YOUR MOVE? 1 

YOUR MOVE? 1 



THERE ARE 17 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 13 
THERE ARE 9 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 7 
THERE ARE 6 CHIPS ON THE BOARD. 
COMPUTER TAKES 1 CHIP LEAVING 5 . 
THERE ARE 4 CHIPS ON THE BOARD. 
COMPUTER TAKES 3 CHIPS LEAVING- 1 
GAME OVER ... I WIN! ! ! 



. . YOUR MOVE? 4 
. . YOUR MOVE? 1 

YOUR MOVE? 1 
. ■ YOUR MOVE? 1 



THERE ARE 19 CHIPS ON THE BOARD. 
COMPUTER TAKES 1 CHIP LEAVING 18 
THERE ARE 16 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 13 
THERE ARE 10 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 6 
THERE ARE 5 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 1 
GAME OVER ... I WIN! ! ! 



YOUR MOVE? 2 
.YOUR MOVE? 3 
. YOUR MOVE? 1 
. YOUR MOVE? 1 



THERE ARE 21 CHIPS ON THE BOARD. 
COMPUTER TAKES 2 CHIPS LEAVING 19 
THERE ARE 18 CHIPS ON THE BOARD. 
COMPUTER TAKES 1 CHIP LEAVING 17 
THERE ARE 13 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 9 
THERE ARE 5 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 1 ' 
GAME OVER . . . VOU WIN! ! 



. YOUR MOVE? 1 
YOUR MOVE? 4 
. YOUR MOVE? 4 
. YOUR MOVE? 1 



THERE ARE 11 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 7 
THERE RRE 6 CHIPS ON THE BORRD. 
COMPUTER TAKES 1 CHIP LEAVING 5 
THERE ARE 4 CHIPS ON THE BOARD. 
COMPUTER TAKES 3 CHIPS LEAVING 1 
GAME OVER ... I WIN! ! ! 



. . YOUR MOVE? 1 

YOUR MOVE? 1 
. . YOUR MOVE? 1 



THERE ARE 11 CHIPS ON THE BOARD. 
COMPUTER TAKES 4 CHIPS LEAVING 7 



. YOUR MOVE? 8 



98 



FIPFOP 



FLIP-FLOP GAME 



Description 

The object of this game is to change this: 

X XX X XX XX XX 
to this: 



by typing in a number corresponding to the position of an "X" 
in the line. On some numbers one position will change while 
on other numbers, two will change. For example, inputting a 
3 may reverse the X and in position 3 , but it might possibly 
reverse some other position tool You ought to be able to 
change all 10 in 12 or fewer moves. Can you figure out a good 
winning strategy? 

To reset the line to all X' s (same game), type (zero) . To 
start a new game at any point, type 11. 

Program Author 



Michael Kass 
38 Lake Drive 
New Hyde Park, NY 



11040 




Ahl 



99 



PROGRAM LISTING 



5 REM *** CONVERTED TO RSTS/E BV DAVID AHL, DIGITAL 

.16 REM *** CREATED BV MICHAEL KASS HERRICKS HS, NV 

29 PRINT "THE OBJECT OF THIS PUZZLE IS TO CHANGE THIS:'* 

38 PRINT 

49 PRINT "X X X X X X X X X X" 

sa PRINT 

60 PRINT "TO THIS:" 

79 PRINT 

80 PRINT "OOOOOOOOO 0" 

90 PRINT * 

100 &"BY TVPING IN THE NUMBER CORRESPONDING TO THE POSITION OF THE LETTER" 

120 &"0N SOME NUMBERS, ONE POSITION WILL CHANGE, ON OTHERS, TWO WILL CHANGE" 

140 «"T0 RESET THE LINE TO ALL X' S, TVPE a. <ZERO) AND TO START A NEW" 

160 *"IN THE MIDDLE OF A GAME, TVPE 11 (ELEVEN)' 

170 PRINT 

180 RANDOMISE 

190 LET G=RND<V> 

200 PRINT "HERE IS THE STARTING LINE OF X' S : ■ 

210 PRINT 

220 LET i>0 

230 PRINT "1 224567 8 9 10" 

240 PRINT "X X X X X X XX X X* 

250 PRINT 

260 DIM A$<20> 

270 FOR X=l TO 10 

280 LET A*<X)="X" 

290 NEXT X 

300 GO TO 328 

310 PRINT "ILLEGAL ENTRV— TRV AGAIN" 

320 PRINT "INPUT THE NUMBER".: 

330 INPUT N 

340 IF NO I NT <N> THEN 310 

350 IF N=ll THEN 189 

360 IF N>11 THEN 310 

370 IF N=0 THEN 230 

388 IF M=N THEN 516 

390 LET M=N 

400 IF A*<N>«"0" THEN 480 

410 LET A$<N>="0" 

420 LET R=TAN<G!+N/G!-N)-SIN<G/N)+226*SIN<. 8*N> 

'130 LET N=R-INT<R> 

440 LET N=INT('10*N> 

450 IF A*<N>="0" THEN 480 

460 LET A*<N> = ''0" 

470 GO TO 610 

480 LET A$':N> = "X" 

490 IF M=N THEN 42© 

580 GO TO 610 

510 IF A*<N>="0" THEN 590 

520 LET A*<N>="0" 

530 LET R=. 592*C0T<G/N+G)/'SIN<N*2+G!)-C0S<N> 

540 LET N=R-INT<R> 

550 LET N=INT<10*N> 

560 IF A*<N)-"0" THEN 590 

570 LET A*<N>="0" 

588 GO TO 610 

590 LET A$<N>="X" 

680 IF M=N THEN 520 

610 PRINT"1 2 3 4 5 6 7 8 9 10" 

620 PRINT A*<Z>" ";FOR 2=1 TO 10 

630 LET C=C+1 

640 PRINT 

650 FOR 2=1 TO 10 

660 IF A*<2><>"0" 

67Q NEXT 2 

680 IF C>12 THEN 710 

6^Q PRINT"VERV GOOD. 

700 GO TO 720 

710 PR I NT "TRV HARDER NEXT TIME, IT TOOK VOU 

728 PRINT "DO VOU WANT TO DO ANOTHER PU22LE" 

738 INPUT X$ 

740 IF X*="NO" THEN 780 

769 PRINT 

770 GO TO 188 
780 END 

READV 



THEN 220 



VOU GUESSED IT IN ONLV "C" GUESSES! 



sample mm 

THE OBJECT OF THIS PUZZLE IS TO CHANGE THIS: 
X X X X XX XX XX 
TO THIS: 



BV TVPING IN THE NUMBER CORRESPONDING TO THE POSITION OF THE LETTER 
ON SOME NUMBERS, ONE POSITION WILL CHANGE, ON OTHERS, TWO WILL CHANGE 
TO RESET THE LINE TO ALL X'S, TVPE O <ZERO) AND TO START A NEW PUZZLE 
IN THE MIDDLE OF A GAME, TVPE 11 <ELEVEN) 

HERE IS THE STARTING LINE OF X' S : 

1 2 3 4 5 6 7 8 9 10 
X X X X X X X X X X 



INPUT 


THE 


NUMBER? 1 


12 3 


4 5 


6 7 8 9 10 


X X 


X X 


X X X X 


INPUT 


THE 


NUMBER? 2 


12 3 


4 5 


6 7 8 9 10 


X 


X X 


X X X X 


INPUT 


THE 


NUMBER? 3 


12 3 


4 5 


6 7 8 9 18 





X X 


X X X 


INPUT 


THE 


NUMBER? 4 


12 3 


4 5 


6 7 8 9 10 


X 


X 


X X X 


INPUT 


THE 


NUMBER? 5 


1 2 3 


4 5 


6 7 8 9 10 


X 





X X X X 


INPUT 


THE 


NUMBER? 6 


12 3 


4 5 


6 7 8 9 10 


X 





X X X X 


INPUT 


THE 


NUMBER? 7 


12 3 


4 5 


6 7 8 9 10 


X X 





X X X 


INPUT 


THE 


NUMBER? 8 


12 3 


4 5 


6 7 8 9 10 


X X 





X X 


INPUT 


THE 


NUMBER? 9 


1 2 2 


4 5 


6 7 8 9 10 


X X 





X 


INPUT 


THE 


NUMBER? 10 


12 3 


4 5 


6 7 8 9 10 


X 








INPUT 


THE 


NUMBER? 1 


12 3 


4 5 


6 7 8 9 10 








X 


INPUT 


THE 


NUMBER? 6 


12 3 


4 5 


6 7 8 9 18 








0X00 


INPUT 


THE 


NUMBER? 8 


12 3 


4 5 


6 7 8 9 18 











TRV HARDER NEXT TIME, 



IT TOOK VOU 13 GUESSES 
DO VOU WANT TO DO ANOTHER PU22LE? YES 



HERE IS THE STARTING LINE OF X'S: 



12 3 


4 5 


6 7 8 9 10 


X X X 


X X 


X X X X X 


INPUT 


THE 


NUMBER? 1 


12 3 


4 5 


6 7 8 9 10 


X X 


X 


X X X X X 


INPUT 


THE 


NUMBER? 2 


12 3 


4 5 


6 7 8 9 10 


X X 


X 


X X X X X 


INPUT 


THE 


NUMBER? 3 


12 3 


4 5 


6 7 8 9 10 


X 


X X 


XX X X X 


INPUT 


THE 


NUMBER? 4 


12 3 


4 5 


6 7 8 9 10 


X X 


X 


XXX X X 


INPUT 


THE 


NUMBER? 5 


12 3 


4 5 


6 7 8 9 10 


X X X 





X X X X X 


INPUT 


THE 


NUMBER? 6 


12 3 


4 5 


6 7 8 9 10 


X X 





OX X X X 


INPUT 


THE 


NUMBER? 7 


12 3 


4 5 


6 7 8 9 10 


X X 


X 


X X X 


INPUT 


THE 


NUMBER? 8 


12 3 


4 5 


6 7 8 9 10 


X X 


X X 


X X 


INPUT 


THE 


NUMBER? 9 


12 3 


4 5 


6 7 8 9 10 


X X 


X 


X 


INPUT 


THE 


NUMBER? 10 


12 2 


4 5 


6 7 8 9 10 


X X 








INPUT 


THE 


NUMBER? 1 


12 3 


4 5 


6 7 8 9 18 


X 


X 





INPUT 


THE 


NUMBER? 3 


12 3 


4 5 


6 7 8 9 10 












A'ERY GOOD. VOU GUESSED IT IN ONLV 12 GUESSES! 
DO VOU WANT TO DO ANOTHER PUZZLE? NO 



100 



FOOTBL 



GAME OF FOOTBALL 



Description 



Football is probably the most popular simulated sports game. 
Some people have elected to play computerized football in 
preference to watching a bowl game on television. 

The simulation uses standard professional football rules ex- 
cept there are no penalties. The computer takes the part of 
your opposing team and also the referee. Eight plays can be 
run on offense and five on defense. The program presents 
necessary rules as you play. 

Source 

Two versions of football are presented herein, A third version 
received from Paul Garmon of Wellesley Jr. High School is not 
printed. 



FOOTBL: 

Digital Equipment Corp. 
Maynard, MA 01754 



FOTBAL: 

Raymond W. Miseyka 
Butler Sr. High School 
Butler, PA 16001 




"Look! Jim has the ball! See him run! Run, Jim, run! 

101 



FOOTBL PROGRAM LISTING 



r» 



10 PRINT "THIS 18 A DEMONSTRATION OF PDP-11 BASIC" 

20 PRINT "IF YOU NEED INSTRUCTIONS FOR PLAYING FOOTBALL, TYPE 

30 INPUT I 

40 IF !<>1 THEN 340 

50 PRINT 

60 PRINT 

70 PRINT "WHEN IT ASKS YOU A QUESTION TO BE ANSWERED YES OR" 

80 PRINT "NO, TYPE IN FOR NO OR 1 FOR YES," 

90 PRINT'' ■ ■ 

100 PRINT "ON OFFENsE YOu HAVE THE FOLLOWING PERMITTED PLAYS*" 

H0 print «play«»« , code" 

120 PRINT "RUN", "10" 

130 PRINT "PASS", "11" 

140 PRINT "SWEEP", "12" 

150 PRINT "SCREEN PASS", "13" 

160 PRINT "LONG PASS",«i4« 

170 PRINT "DRAW PLAY", "15" 

180 PRINT "PUNT", "16" 

190 PRINT «FIELDG0AL","l7" 

200 PRINT 

210 print "on defense, yoy may try one of the following i" 
220 print "defense", "code" 

230 PRINT "NqrMAL", "4%«G000 AGAINST SWEEp AND SCREEN" 

240 PRInT "HOLD", "5", "GOOD AGAINST RUN, PASS AnD DRAW" 

250 PRINT "BlITZ","6",«600D AGAINST PASS OR LONG PASS" 

260 PRJNT "INTERCEPT", "7", "INCREASES ThE ODDS FOR AN INTERCEPTION" 

270 PRINT "BLOCK", "8", "GIVES YOU A CHANCE TO BLOCK A KICK," 



280 PRINT 

290 PRINT 

300 print 

310 PRINT 

320 PRINT 



«,« ", 



"BUT DECREASES THE DISTANCE RUNBACK." 



,0,9,10,12,11,12,0,1,5,3,4,6,2,8,7 



"TO CALL A PARTICULAR PLAY JUST TYPE ITS CODE NuMBEr." 
"ALSO, AT ANY TIME DURING pLAYYoU MAY CALL TIME UT" 
"BY TYPING A 12', H wEVER YqU ARE PERMITTED ONLY THREE" 

330 PRINT "TIMEOUTS PER HAlF," 

340 PRINT 

350 PRINT 

360 DEF FNT(X)«SIN(X)/COS(X) 

370 DIM R(17) 

380 FOR I«0 TO 17 

390 READ R(I) 

400 NEXT I 

410 DATA 9,13,10 

420 randomize 

430 LET F*0 ; 

440 LET Z3"0 

450 LET O»0 

460 LET L»0 

470 DIM Z(5,3),P(2),D(2,5) 

480 FOR A»0 TO 5 

490 FOR B»0 TO 2 

500 READ Z(A,B),D(B,A) 

505 LET P(B)»0 

510 NEXT B 

520 READ Z(A,3) 

530 NEXT A 

540 PRINT "Do YOU WANT TO RECEIVE"? 

550 LET X"l 

560 GOSUR 3610 

570 LET S«2-SGN(13-Q) 

580 LET K.S 

590 LET Tlsl20 

600 LET U2«3 

610 LET U«3 

620 LET C«900 

630 GOSUB 2250 

640 LET Fl»50 

650 |_ET B* I NT ( F 1 + o*20*RnD ( ) ♦ ( 1 ~0 5*29* (2*RND ( 0) *7-RnD C0 ) a (3«Z2 ) ) ) 

660 LET Q»0 

670 LET Z9«8 

680 GOSUB 1490 

690 LET L«0 

700 IF B<«99 THEN 2340/' 

710 PRINT "A TOUCHBACK" 

720 LET B«20 

730 LET L«0 .. ■""■fW ■ ' ■ " . 

740 IF S*2 THEN 770 

750 PRINT "MY "J 

760 GOTO 780 

77^ PRINT "YOUR "? 

780 GOSUB 3290 

790 GOSyB 2980 

800 LET DM 

810 LET F2-.03 

820 LET 0*0 

830 IF C<*0 THEN 2770 

840 GOSUB 2530 

850 LET Z2«l 

860 LET Z 3 «,3 

870 IF C<»F*Ti THEN 29255 

880 IF C<*0 THEN 2770 ■ 

890 IF L«0 THEN 910 

900 pr i nt "time to go--"; 

910 PRINT INT(C/60)7">1IN, 

920 PRINT "YOUR PLAY"* 

930 GOSUB 3610 

940 IF Sal THEN 98« 

950 IF Q>8 THEN 920 

960 LET M«Q 

970 GOTO 1000 

980 LET Y"G-8 

990 IF ABs(Q»10,5)a2>3 THEN 920 

1000 LET C»InT(C-L*(5+23*r n D(XJ)) 

1010 lET l«1 

1020 IF M»7 THEN 1760 

1030 IF M«8 THEN 1920 

1040 LET Yl.Y-1 

1050 IF RNDCX)>ZCM-t,Y!) THEN 1240 

1060 LET A-2 

1070 GOSUB 3020 

1080 IF M<4 T HEN 1110 

1090 print "pass complete,, «i 

1100 LET L"SGn(InT(4*RnO(0))V 

1110 IF RND(X)<F2 THEN 2510 

1120 IF G>0 THEN 1210 

1130 IF G.0 THEN 1170 

1140 IF G*8<1 THEN 21 7 

1150 PRINT "LOSS OF«|-G| 

U60 GOTO 1610 

1170 PRINT "NO GAIN" 

1180 LET Z9-2 

1190 GOSUB 1490 



>C-60>iNT CC/60J7 "SEC , 



102 



1200 GOTO 1670 

1210 IF B*G>99 THEN le50 

1220 PRINT "GAIN OF"|G> 

1230 GOTO 1610 

1240 IF M>3 THEN 1280 

1250 LET A«l 

1260 GOSUB 3020 

1270 GOTO 1120 

1280 IF PND'CX)« t 06*C2»SGN(y»3)) THEN 1360 

1290 IF RND(0X,05*INT(Y/3.5)/5 THEN 1510 

1300 LET Z9-6 

1310 GOSUB 1490 

1320 PRINT "PASS INCOMPLETE" 

1330 LET L»0 

1340 LET G-0 

1350 GOTO 3120 

1360 PRINT "PASS ♦♦INTERCEPTED^"* 

1370 LET A«l 

1380 GOSUB 3020 

1390 IF B<40 THEN 1410 

1400 LET G»20*(1+sGn(G)) 

1410 LET BM00-B-G 

1420 LET S"3-S 

1430 LET Z9«9 

1440 GOSUB 1490 

1450 IF B<1 THEN 710 

1460 IF B>99 THEN 1650 

U70 PRINT "AT "I 

1480 GOTO 2360 

1490 LET C»C-INt(4+z9/2*(URND(0))) 

1500 RETURN 

1510 LET G»-(5+InT(10*RND(X))) 

1520 PRINT "THE QUARTERBACK "» 

1530 iF RND(X)>,5 ThEn 1560 

1540 print "is Thrown for a «i 

1550 GOTO 1110 
1560 LET G«-(2*G*8) 
1570 LET M«b 
1580 LET A«i 

1590 PRINT "SCRAMBLES FOR A «) 
1600 GOTO 1110 
1610 LET BaB+G 
1620 PRINT "TO "I 
1630 GOSUB 3300 
1640 IF B<*99 THEN 1670 
1650 GOSUB 1990 
1660 GOTO 630 
1670 IF B1>B THEN 3120 
1680 IF BKB THEN 1730 
1690 IF RND(0)>,5 THEN 1730 
1700 PRINT "♦♦MEASUREMENT**" 
1710 GOSUB 3520 
1720 IF RND(X)<,5 THEN 3120 
1730 GOSUB 2980 
1740 LET D«0 
1750 GOTO 3120 

1760 IF RND(X)<,06 THEN 1890 
1770 LET B«B+30*inT(15*(1*RNd(*)a3)) 
1780 LET Z9«2 
1790 GOSUB 1490 
1800 IF B<»99 THEN ls50 
1810 LET P.t«3~ 
1820 GOSUB 2030 
1830 IF Pt«0 THEN 710 
1840 GOTO 630 ":.,■;. 
1850 PRINT "THE KICK IS "f 
i860 LET Z2»0 
1870 LET S«3-S 
I860 GOTO 2340 

1 89 PR IN T " ♦ ♦BLOC K E D ♦♦ R E C V ERED . * " I 
1900 LET :G«*INTC14^RND(X)) 
1910 GOTO 1.4^0 
1920 PRINT "THE PUNT IS "I 
.< 1930 IF RND(xX,06: THEN * ;1890- >. 
1940 LET F1«B 
1950 LET Z2»l 
1960 LET S«3-S > 
1970 LET Z3s,65 
1980 GOTO 650 

1990 PRINT "♦♦TOUCHDOWN**" 
2000 LET Pi* 1 : 
2010 LET P(S)«P(S)+6 
2020 LET 8«130 ' 
2030 PRINT "THE kICk IS "I 
2040 IF RND C X ) < (B/ 132 J a4 THEN 2070 
2050 LET P1«0 
2060 PRINT "NO "I 
2070 PRINT "GOOD" 
2080 LET PCS)»P(S)*P1 
2090 GOSUB 2120 
2100 LET S«3-S 
2110 RETURN 

2120 PRINT "SCORE! ME«JPC1) i" Y0U^lR(2) 
2130 LET L«0 
2140 IF X<5 THEN 2160 

2150 if p(i)op(2) then 2770 

2160 RETURN 

2170 PRINT »**SAFETY^ n 

2180 LET P(3-S)«P(3-S)+2 

2190 LET Fi«j0 

2200 LET S«3-s 

2210 GOSUB 2120 

2220 GOSUB 3440 

2230 PRINT "FROM THE 20" 

2240 GOTO 650 

2250 GOSUB 3440 

2260 IF S«2 fHEN 2330 

2270 PrINt "0N- S IDE«> 

2280 GQSUB 3610 

2290 if Q<>13 THEN 2330 

2300 LET F 2« .15 

2310 LET Z2«l 

2320 LET 0«1 

2330 RETURN 

2340 LET B»100-.B 

2350 PRINT "RECEIVED AT «| 

2360 GOSUB 3300 

2370 IF Z2^RND(X)>Z3 THEN 2490 

2380 IF RNp(X)<F2 THE N 2500 

2390 LET Ga5+XNT(100*RND(0)) 



2400 IF RND(0)<,15 THEN 2430 

2410 LET G«INT(24*C1-RN0(X)a2)) 

2420 IF G«0 THEN 2490 

2430 LET B-B+G 

2440 PRINT » AND RUN BACK,,,»J 

2450 LET L«i 

2460 IF B>99 THEN 1650 

2470 PRINT » TO "I 

2480 GOSUB 3300 

2490 IF RNO(0)>p2 THEN 3260 

2500 LET G"0 

2510 PRINT "**FUMBLE**"I 

2520 GOTO 1410 

2530 IF 8«i THEN 2560 

2540 LET Y«INTfl+3.5*RNO(0)) 

2550 RETURN 

2560 LET M«INt(55*RNO(0)/10,5)+1 

2570 IF (Bl-B)/(5-0)«3 THEN 2590 

2580 LET M«InT(.6"4*RNO(0)a2') 

2590 IF L* F *60>*C THEN 2670 

2600 IF D<* THEN 2550 

2610 PRINT "I'LL " t 

2620 IF 8<55 THEN 2720 

2630 IF 0<4*RND(0)-Bt+8 THEN 2 7 50 

2640 PRINT "THY FOR A FIELD GOAL" 

2650 LET M*7 

2660 RETURN 

2670 IF P(2)*U2<«P(1)*U2 THEN 2600 

2680 PRINT "TIME OUT" 

2690 LET U2*U2-i 

2700 GOSUB 3520 

2710 GOTO 2600 

2720 PRINT "PUNT" 

2730 LET H»8 

2740 RETURN 

2750 PRINj "GO FOR IT" 

2760 RETURN 

2770 IF X<* THEn 2830 

2780 iF P (i)sp(2) ThEn 2830 

2790 PRINT "The GAME IS OVER" 

2800 PRINT "FINAL " I • 

2810 GOSUB 2120 

2820 STOP 

2830 PRINT "END OF PERI0D"IX 

2840 GOSUB 2120 

2850 LET F«l-F 

2860 GOSUB 3520 

2870 LET C»900 

2880 LET X«X+1 

2890 IF F<>0 THEN 810 

2900 LET S«3-K 

2910 GOTO 580 

2920 IF Ti»{j THEN 277g 

2930 PRINT "2 MINUTE WARNING" 

2940 GOSUB 3520 

2950 LET T1«0 

2960 LET C*120 

2970 GOTO 880 

2980 LET BUB + 10 

2990 IF Bi<«i00 THEN 30J0 

3000 LET Bl"i00 

3010 RETURN 

3020 LET Q"l,3*(A* R NO(0)-l)-,06 

30313 LET A.J 

3040 IF o>"0 THEN 3070 

3050 LET A«0 

3060 LET Q*-Q 

3070 LET Mi.M-1 

3080 LET G«D(A,MlJ+FNT(O)*(0(2,Ml)-D(A,M-i))/3.5 

3090 LET G«G + INT<RND(0J + .02)*A*1<30*RND(0> 

3100 LET G«INTCG) 

3110 RETURN 

3120 LET DbD+1 

3130 IF D»5 THEN 32*0 

3140 IF D<> 1 THEN 3160 

3150 PRINT "1ST" J 

3160 IF D<>2 THEN 3180 

3170 PRINT "2ND"* 

3180 IF D<>3 THEN 32^0 

3190 PRINT "3RD"; 

3200 IF D<4 THEN 3220 

3210 PRINT "4TH»J 

3220 PRINT « AND";B1-B?« »J 

3230 GOTO 810 

3240 LET S«3-S 

3250 LET B»100-B 

3260 ip S«2 THEN 770 

3270 PRINT "MY "J 

3280 GOTO 780 

3290 PRINT "BALL ON "j 

3300 IP B«50 THEN 3400 

3310 LET ■ V«50-"ABS(.B-50) 

3320 LET CsC-INT(7+3*RND(03) 

3330 IF S«l THEN 3420 

3340 IF 8<50 THEN 3370 

3350 PRINT "MY "> 

3360 GOTO 3380 

3370 PRINT "YOUR "I 

3380 PRINT V 

3390 RETURN 

3400 PRINT "THE 50" 

3410 RETURN 

3420 IF B<50 THEN 3350 

3430 goto 33*70 

3440 IF S*2 THEn 3470 

3450 PRINT "YOU"? 

3460 GOTO 3480 

3470 PRINT «I"> 

3480 PRINT " KICK OFF." 

3490 LET F2*.06 

3500 LET Z2»0 

3510 RETURN 

3520 LET L»0 

3530 PRINT "TIMEOUT CA LL ED,..« 

3540 PRINT 

3550 RETURN 



3560 
3570 
3580 
3590 
3600 
3610 
3620 
3630 
3 6 40 
3650 
3660 
3670 
3680 
3690 
3700 
3710 
3720 
3730 



IF U»0 THEN 
LET U"U-i 
GOSUB 3520 
GOtO 3610 
PRINT h ..wro 
INPUT A 
IF ABSCINTCA 
LET Q.RCINTC 
IF Q»0 THEN 
IF Qil00 THE 
RETURN 
DATA .5,-2, 
DATA .4,-2, 
DATA ,4.-2,, 
DATA ,65,-2, 
DA T A ,4,2, ,7 
DATA .1,19,, 
END 



3600 



NG, TRY A 

))>17 THE 
ABS(A)» 

3600 
N 3560 

25,4, .5,1 
3,7, .65,1 
3,6, ,6, 15 
.65,6, ,6 

10, .4,27 
4,35, .2,1 



GAI N « 

N 3600 



3, .55 
5#.75 

35 
17, .9 

2 

..1 



FOOTBL SAMPLE RUN 



THIS IS R DEMONSTRATION OF PDP-11 BASIC 

IF VOU NEED INSTRUCTIONS FOR PLAYING FOOTBALL, TYPE A 1? 1 



WHEN IT ASKS VOU A QUESTION TO BE ANSWERED YES OR 
HO, TYPE IN O FOR NO OR 1 FOR YES. 



ON OFFENSE VOU HAVE THE FOLLOWING PERMITTED PLAYS: 



PLAY 


CODE 


RUN 


19 


PASS 


11 


SWEEP 


12 


SCREEN PASS 


13 


LONG PASS 


14 


DRAW PLAY 


15 


PUNT 


16 


FIELDGOAL 


17 


ON DEFENSE, 


VOU MA 


DEFENSE 


CODE 


NORMAL 


4 


HOLD 


5 


BLITZ 


6 


INTERCEPT 


7 


BLOCK 


8 



r'OIJR PLAY? 12 
r'OUR PLAY? 11 
YOUR PLAY? 10 
YOUR PLAY? 13 
YOUR PLAV? 14 
15 
YOUR PLAY? 10 
YOUR PLAV? 14 
> 14 



G D A G A I N S T S W E E P AND S ORE E N '' 
GOOD AGAINST RUN, PASS AND DRAW 
GOOD AGAINST PASS OR LONG PASS 
INCREASES THE ODDS FOR AN INTERCEPTION 
GIVES YOU A CHANCE TO BLOCK A KICK, 
BUT DECREASES THE DISTANCE RUNBACK. 



TO CALL A PARTICULAR PLAV JUST TYPE ITS CODE NUMBER. 
ALSO, AT ANY TIME DURING PLAY VOU MAY CALL TIME OUT 
BY TYPING A ■•2'-. HOWEVER VOU ARE PERMITTED ONLY THREE 
TIMEOUTS PER HALF. 



DO YOU WANT TO RECEIVE? 1 

I KICK OFF. 

ft TOUCHBACK 

VOUR BALL ON YOUR 20 

14 MIN, 42 SEC. VOUR PLAY? 10 
.LOSS OF 1 TO VOUR 13 

2ND AND 11 TIME TO GO-- 14 MIN, 34 SEC! 
LOSS OF 2 TO YOUR 1? 

3RD AND 13 TIME TO GO— 14 MIN, 13 SEC. 
PASS COMPLETE. . GAIN OF 12 TO VOUR 29 
4TH AND 1 TIME TO GO — 13 MIN, 43 SEC. 
GAIN OF 10 TO VOUR 39 

1ST AND 10 TIME TO GO— 13 MIN, 24 SEC. 
PASS COMPLETE. . GAIN OF 7 TO YOUR 46 
2ND AND 3 TIME TO GO— 13 MIN, 8 SEC. ' 
PASS INCOMPLETE 

3RD AND 3 12 MIN, 32 SEC. VOUR PLAV? 
GAIN OF 2 TO VOUR 48 

4TH AND 1 TIME TO GO-- 12 MIN, 24 SEC. 
GAIN OF 5 TO MY 47 

1ST AND 10 TIME TO GO — 12 MIN, 4 SEC. 
PASS INCOMPLETE 

2ND AND 10 11 MIN, 46 SEC. VOUR PLAV 
PASS INCOMPLETE 

3RD AND 10 11 MIN, 38 SEC. VOUR PLAV? 11 
PASS COMPLETE. . GAIN OF 13 TO MY 34 
1ST AND 10 11 MIN, 31 SEC. VOUR PLAV? 10 
GAIN OF 1 TO MY 33 

2ND AND 9 TIME TO GO— 11 MIN, 22 SEC. YOUR PLAV? 12 
NO GAIN 

3RD AND 9 TIME TO GO— 10 MIN, 51 SEC. VOUR PLAY? 13 
PASS COMPLETE. . LOSS OF 1 TO MY 34 

4TH AND 18 TIME TO GO— 10 MIN, 36 SEC. YOUR PLAY? 17 
THE KICK IS NO GOOD 
SCORE : ME Q VOU O 
A TOUCHBACK 
MV BALL ON MY 20 

10 MIN, 10 SEC. VOUR PLAV? 4 
GAIN OF 2 TO MV 22 

2ND AND 8 TIME TO GO-- 10 MIN, 3 SEC. 
PASS COMPLETE. . GAIN OF 6 TO MV 28 
3RD AND 2 TIME TO GO-- 9 MIN, 37 SEC. 
GAIN OF 6 TO MV 34 

1ST AND 10 TIME TO GO-- 9 MIN, 8 SEC. 
LOSS OF 1 TO MV 33 

2ND AND 11 TIME TO GO-- 8 MIN, 41 SEC 
PASS COMPLETE. . GAIN OF 16 TO MV 49 
1ST AND 10 8 MIN, 11 SEC. YOUR PLAY? 4 
PASS INCOMPLETE 

2ND AND 10 8 MIN, 2 SEC. YOUR PLAY? 5 
GAIN OF 12 TO VOUR 39 

1ST AND 10 TIME TO GO— 7 MIN, 53 SEC. VOUR PLAV? 4 
GAIN OF 1 TO VOUR 38 

2ND AND 9 TIME TO GO-- 7 MIN, 22 SEC. 
GAIN OF 1 TO VOUR 37 

3RD AND 8 TIME TO GO-- 7 MIN, SEC. 
P A S S C M P L E T E . . • G A I N OF 15 T V U R 2 2 
1ST AND 10 TIME TO GO — 6 MIN, 23 SEC 
GAIN OF 7 TO VOUR 15 

2ND AND 3 TIME TO GO— 5 MIN, 53 SEC. 
PASS INCOMPLETE 



VOUR PLAV? 5 
YOUR PLAV? 4 
YOUR PLAY? 5 _ 
YOUR PLAY? 5 



YOUR PLAY? 4 
YOUR PLAV? 4 
VOUR PLAV? 4 
VOUR PLAY? 5 



103 



FOTBAL PROGRAM LISTING 



PROGRAM WRITTEN BV RAYMOND W. MISEVKfl 
SENIOR FIT BUTLER SENIOR HIGH SCHOOL 

BUTLER.. PENNSYLVANIA 16001 
DATE: 1/30/73 

COMPUTER SUPERVISION- MR. WILLIAM ELLIS 
COMPUTER TOPICS INSTRUCTION- MR. ALBERT STEWERT 

I WROTE THIS PROGRAM BECAUSE OF THE CHALLENGE 
INVOLVED IN OVERCOMING THE COMPLEXITIES OF SUCH A GAME 



.. C < 4 @ ) , H < 2 ) , T < 2 > , W < 2 > , X < 2 ) , V < 2 ) .• Z < 2 > 



FOOTBALL (NO FORTRAN USED)" 



1 REM 

2 REM 

3 REM 
'4 REM 

5 REM 

6 REM 
? REM 
3 REM 
9 REM 
18 REM 

100 RANDOMIZE 
120 DIM A<20>,B<20> 
130 DIM M*<2>,D<2> 

140 PRINT "RAMIS ENTERPRISES PRESENTS N. F. U. 
145 PRINTSPRINT 
150 PRINT "DO YOU WISH INSTRUCTIONS?",- \ INPUT A* 
160 JF A**"NO" THEN 290SIF A*<>"VES" THEN 150 

178 PRINT "THIS IS A GAME FOR 2 TEAMS IN WHICH EACH PLAYER MUST" 

180 PRINT "PREPARE A TAPE WITH A DATA STATEMENT (1770 FOR TEAM 1" 

190 PRINT "1780 FOR TEAM 2) IN WHICH EACH TEAM SCRAMBLES NOS. 1-20" 

195 PRINT "THESE NUMBERS ARE THEN ASSIGNED TO 20 GIVEN PLAYS. " 

200 PRINT "A LIST OF NOS. AND THEIR PLAYS ARE PROVIDED WITH" 

210 PRINT "BOTH TEAMS HAVING THE SAME PLAYS. THE MORE SIMILAR THE" 

220 PRINT "PLAYS THE LESS YARDAGE GAINED. SCORES ARE GIVEN" 

223 PRINT "WHENEVER SCORES ARE MADE. SCORES MAY ALSO BE OBTAINED" 

225 PRINT "BY INPUTING 99, $9 FOR PLAY NOS., TO PUNT OR ATTEMPT A" 

227 PRINT "FIELDGOAL.. INPUT 77.- 77 FOR PLAY NOS,. QUESTIONS WILL BE" 

230 PRINT "ASKED THEN. ON 4TH DOWN YOU WILL ALSO BE ASKED WHETHER" 

240 PRINT "VOU WANT TO PUNT OR ATTEMPT A FIELD GOAL. IF THE ANSWER" 

250 PRINT "TO BOTH QUESTIONS IS NO, IT WILL BE ASSUMED YOU WANT TO" 

260 PRINT "TRY AND GAIN YARDAGE. ANSWER ALL QUESTIONS YES OR NO. " 

270 PRINT "GAME IS PLAYED UNTIL PLAYERS TERMINATE <CONTROL-C>. " 

280 PRINT "PLEASE PREPARE A TAPE AND RUN, "SSTOP 

290 PRINTSPRINT "INPUT SCORE LIMIT ON GAME".! \ INPUT E 

390 FOR 1*1 TO 40SREAD NMF I>20 THEN 350 

330 A<N>=ISGOTO 360 

350 B<N>=I-20 

360 C<I')*N\NEXT I 

380 L=OST=l 

410 PRINT " TEAM" T" PLAY CHART" 

420 PRINT "NO. PLAY" SPRINT 

430 PRINT C<1+L)jTAB<6)j "PITCHOUT" 

'♦40 PRINT C<2 + L):.TAB<6).; "TRIPLE REVERSE" 

'450 PRINT C<3 + L>.i TAB<6>.; "DRAW" 

460 PRINT C<4+L>; TAB<6>; "QB SNEAK" 

'470 PRINT C<5 + L);TAB<6:».; "END AROUND" 

480 PRINT C<6 + L); TAB < 6),: "DOUBLE REVERSE" 

490 PRINT C(7+L).iTAB<6); "LEFT SWEEP" 

500 PRINT C<8+L>,TAB<6>; "RIGHT SWEEP" 

510 PRINT C<-9+L>; TAB-: 6).; "OFF TACKLE" 



520 PRINT C<18+L> 
530 PRINT C<:il + L> 
540 PRINT C<12+L> 
550 PRINT CU3 + L) 
560 PRINT C(14+L> 
570 PRINT C':i5+L,> 
588 PRINT C<16+L> 
590 PRINT C<17+L) 
600 PRINT C':i8+L) 
610 PRINT C-:i9+L) 
620 PRINT C<20+L) 
630 L*L+20ST=2 
640 PRINTSPRINT 



TAB<6).; "WISHBONE OPTION" 
TAB<6).i "FLARE PASS" 
TAB<6).; "SCREEN PASS" 
TAB < 6 ) ; " ROLL OUT OPT I ON " 
TAB< &>} "RIGHT CURL" 
TAB (6).; "LEFT CURL" 
T A 8 < 6 > ,• " WISH B N E P T 1 N " 
TAB < 6 ) ,• " S I DEL I NE PASS " 
TAB<6>; "HALF-BACK OPTION" 
TABc'6).; "RAZZLE DAZZLE" 
TAB-:6>,- ''BOMB! !!'!!!!" 



TEAR OFF HERE 



66Q 


FOR X 


670 


FOR Z 


680 


IF L = 


690 


d < i y- 


700 


h-:i> = 


710 


W'll> = 


720 


v .; i > = 


725 


GOSUB 


730 


PRINT 


740 


T=INT 


760 


PRINT 


765 


P=X<T 


778 


GOSUB 


780 


K-INT 


790 


P=P-Y 


794 


IF W< 


795 


PRINT 


810 


PRINT 


830 


PRINT 


840 


IF A* 


350 


IF W< 


870 


P=Z-:T 


880 


D=1SS- 


385 


PRINT 



2> = "€ " 



-1 TO 11SPRINTSNEXT ! 

=1 TO 3000SNEXT Z 

20 THEN 410 

0SD< 2 >-3SM$ <!>="— ^>"SM*<2 

0SH < 2 ) =0ST i 1 ) =2ST < 2 > =1 

-1SW<2>=1SX<1)=100SX<2)=0 

IS V < 2 ) *-lSZ < 1 > = 0SZ < 2 > =100 

1910 

"TEAM 1 DEFENDS YD. GOAL — TEAM 2 DEFENDS 100 YD. GOAL" 
<2*RND<0>+1> 

SPRINT "THE COIN IS FLIPPED" 
>-V<T>*40 

1860SPRINTSPRINT "TEAM»T"RECE IVES KICK-OFF" 
<26*RND('O)+40) 

•:t>*k 

t)*p<z<t)+10 then 810sprintsprint "ball went out of endzo 

"—automatic touchback— "sgoto 870 
sprint "ball went "k" yards, now on "psgosub 1900 

" team" t" do vou want to runback".: si nput a* 
="ves" then 1430sif a*o"n0" then 830 
t>*p<z<t> then 880 

)-Wa>*20 
=?p 



390 PRINTSPRINT " TEAM" T "DOWN "D "ON "P.; 
393 IF DOl THEN 900 

395 IF V':T}*cP+V':T>*10>> = X<T> THEN 898 
897 C=4SG0T0 988 



398 C=3 

900 IF C=3 THEN 904 

901 PRINT TflB.<27>;10-<Y<T)*P-V<T)*S>; "YARDS TO 1ST DOWN" 

902 GOTO 910 

904 PRINT TAB<27)jX<T)-Y<T)*P.: "YARDS TO GO" 

910 GOSUB 1990S IF D=4 THEN 1189 

928 RANDOMIZE 

938 U=INT<3+RND<0)-1)SG0T0 940 

936 PRINT "ILLEGAL PLAY NUMBER, CHECK AND" 

940 PRINT "INPUT OFFENSIVE PLAY, DEFENSIVE PLAY".; 

959 IF T-2 THEN 970 

960- INPUT P1..P2SG0T0 975 

970 INPUT P2,P1 

975 IF Pl=77 THEN 1180 

980 IF Pl>20 THEN 1880SIF PK1 THEN 1800 

998 IF P2>20 THEN 1880SIF P2<1 THEN 1880 

995 Pi=INT<Pi:>SP2-INT<P2> 

1009 V= I NT < ABS < A < PI :» -B < P2 > > /19* < < X < T ) - V < T ) *P+25 ) +RND < ) -15 ) ) 

1805 PR I NTS IF T = 2 THEN 1015 

1019 IF A<P1K11 THEN 1048SGOTO 1820 

1815 IF B<P2H!1 THEN 1048 

1028 IF UO0 THEN 1035SPRINT "PASS INCOMPLETE TEAM"T 

1038 Y=0SGOTO 1059 

1035 G=RND<0>SIF GC 025 THEN 104OSIF V>2 THEN 1945 

1048 PRINT "QUARTERBACK SCRAMBLED "SGOTO 1050 

1045 PRINT "PASS COMPLETED "SGOTO 105© 

1048 PRINT "THE BALL WAS RUN" 

1950 p=p-wa>*v 

1860 PRINTSPRINT "NET YARDS GAINED ON DOWN"D"ARE "V 

1870 G=RND<0>SIF G>. 025 THEN 1118 

1880 PRINTSPRINT "** LOSS OF POSSESSION FROM TEAM "T" TO TEAM"T(T) 

1100 GOSUB 1850SPRINTST = T':T)SGOTO 838 

1118 IF V<T)*P>«X<T) THEN 1320 

1129 IF U<T)*P>rZ<T) THEN 1238 

1138 if va:>*p-v<T;>+s>=i0 then 888 

1140 D*D+1SIF DOS THEN 885 

1168 PRINTSPRINT "CONVERSION UNSUCCESSFUL TEAM"TST=T<T ) 

1170 GOSUB 1850SGOTO 888 

1188 PRINT "DOES TEAM"T"WANT TO PUNT ".; SI NPUT A* 

1185 IF A$="NO" THEN 1280SIF A*0"VES" THEN 1188 

1190 PRINTSPRINT "TEAM"T"WILL PUNT"SG=RND<0>S I F G<. 825 THEN 

1195 GOSUB 1850SK=INT<25+RND<O>+35>ST*T<T>SGOTO 798 

1280 PRINT "DOES TEAM"T''WANT TO ATTEMPT A FIELD-GOAL"^ MNP 

1210 IF A*="VES" THEN 1648SIF A*O"N0" THEN 1288SG0T0 928 

1238 PRINTSPRINT "SAFETY AGAINST TEAM"T" — - —-- 

1248 H < T < T > ) =*H < T < T ) ) +2SG0SUB 1810 

1280 PRINT " TEAM" T "DO VOU WANT TO PUNT INSTEAD OF A KJCKQFF 

1290 P=Z<T>-W<T>*20SIF A**"VES" THEN 1198 



1328 printsprint "touchdown bv team "t "**************** 

1340 q=7sg=rnd<0)sif g>. 1 then 1388 

1360 q=6sprint "extra point no good "sgoto 1398 

1380 print "extra point good" 

1390 H':t;>=h<t>+qsg0SUB 1810 

1420 T=T<T)SGOTO 765 

1430 K=INT<9+RND<0>+1> 

1440 R*INT<<<X<T)-YCT)*P+25)*RNO<0)-15)/K) 

1468 P«P-W<T)*R 

1480 PRINTSPRINT "RUNBACK TEAM "T.; R"VARDS " 

1485 RANDOMIZESG=RND<0)SIF G<. 025 THEN 1888 

1498 IF Y<T)*P>sX<T> THEN 1328 

1500 IF W(T)*P>'2(T) THEN 1238SG0T0 888 

1640 PRINTSPRINT "TEAM "T "WILL ATTEMPT A FIELDGOAL" 

1645 RANDC'MIZESG = RND<0)SIF GC. 825 THEN 1888 

1658 F- 1 NT c 35*RND < ) +20 ) 

1660 printsprint "kick is "f "yards long" 
1688 p=*p-w<t;>*fsrandomizesg-rno<o> 

1698 IFG<. 35THEN1735 

1700 IF Y<T)*P<X<T> THEN 1748 

1719 PRINT "FIELDGOAL GOOD FOR TEflM"T"*****************YEft" 

1728 Q»3SQ0T0 1398 

1735 PR I NT" BALL WENT WIDE" 

1748 PRINT "FIELDGOAL UNSUCCESSFUL TEAM"T" -i ■ 

1742 GOSUB 1850SIF V<T >*P<X<T )+10 THEN 1745ST=T<T > SGOTO 794 
1745 PRINTSPRINT "BALL NOW ON "P 
1758 T = T':T)SGOSUB 1988SG0T0 838 

1778 DATA 17, 8, 4, 14, 19, 3, 18, ;l, 7, 11, 15, 9, 5, 28, 13, 18, 16, 2, 12, 
1788 DATA 20, 2, 17, 5, 8, 18, 12, 11, 1, 4, 19, 14, 18, 7, 9, 15, 6, 13, 1.6, 
1888 IF P1099 THEN 936 

1818 PRINTSPRINT "TEAM 1 SCORE IS"H(1) 
1828 PRINT "TEAM 2 SCORE IS"H<2>SPR INT 

1825 IF H<TKE THEN 1838SPRINT "TEAM"T"WINS *************.** 
1338 IF Pl=99 THEN 948SRETURN 
1850 PRINT 

1860 PRINT " + + + + + ++ + + +++ +++ + + +++ + + ++++f + 4 + +++ + + 4 + + + + •+ + + + +++ 
+ + + + +".■ 
1370 RETURN 

1900 PRINT TAB<D<T>+5+P/2>,M*<T) 

1918 PRINT "TEAM 1 CO 18 20 30 40 50 m 
J TEAM 2" 
1920 PRINT 
1938 RETURN 
2800 END 



1888 
T A* 
OH-OH" 

SI NPUT 
YEA TEAM" 



"SGOTO 2888 



+++++++++++++ 



104 



SAMPLE RUN 

RflMIS ENTERPRISES PRESENTS N. F. U. FOOTBALL<NO FORTkhN USED) 



DO YOU WISH INSTRUCTIONS?? YES 

THIS IS fl GAME FOR 2 TERMS IN WHICH EACH PLAYER MUST 
PREPARE ft TAPE WITH A DATA STATEMENT (1770 FOR TEAM 1 
1780 FOR TEAM 2) IN WHICH EACH TEAM SCRAMBLES NOS. 1-20 
THESE NUMBERS ARE THEN ASSIGNED TO 20 GIVEN PLAYS. 
A LIST OF NOS. AND THEIR PLAYS ARE PROVIDED WITH 
BOTH TEAMS HAVING THE SAME PLAYS. THE MORE SIMILAR THE 
PLAYS THE LESS YARDAGE GAINED. SCORES ARE GIVEN 
WHENEVER SCORES ARE MADE. SCORES MAY ALSO BE OBTAINED 
BY INPUT I NG 99,99 FOR PLAY NOS.. TO PUNT OR ATTEMPT A 
FIELDGOAL.. INPUT 77,77 FOR PLAY NOS.. QUESTIONS WILL BE 
ASKED THEN. ON 4TH DOWN YOU WILL ALSO BE ASKED WHETHER 
VOU WANT TO PUNT OR ATTEMPT A FIELD GOAL. IF THE ANSWER 
TO BOTH QUESTIONS IS NO, IT WILL BE ASSUMED YOU WANT TO 
TRY AND GAIN YARDAGE. ANSWER ALL QUESTIONS YES OR NO. 
GAME IS PLAYED UNTIL PLAYERS TERMINATE < CONTROL-C > . 
PLEASE PREPARE A TAPE AND RUN. 
STOP AT LINE 288 

READY 



RUNNH 

RAM IS ENTERPRISES 



PRESENTS N. F, U. FOOTBALL < NO FORTRAN USED) 



TEAM 1 CO 10 20 30 40 50 €2 70 80 90 
TEAM 1 DEFENDS 6 YD. GOAL--TEAM 2 DEFENDS 100 YD. GOAL 
THE COIN IS FLIPPED 

-I- + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 

TEAM 2 RECEIVES KICK-OFF 

BALL WENT 52 YARDS, NOW ON 92 

TEAM 1 CO 10 20 30 42 52 62 72 S2 32 

TEAM 2 DO VOU WANT TO RUNBACK? YES 

RUNBACK TEAM 2 18 YARDS 

TEAM 2 DOWN 1 ON 82 18 YARDS TO 1ST DOWN 

TEAM 1 CO 10 20 20 48 58 68 78 88 98 

INPUT OFFENSIVE PLAY, DEFENSIVE PLAY? 19,1:1 

PASS COMPLETED 

MET YARDS GAINED ON DOWN 1 ARE 4 



188 3 TEAM 2 



++++++++++++ 



108 3 TERM 2 



188 3 TEAM 2 



DO YOU WISH INSTRUCTIONS?? NO 

INPUT SCORE LIMIT ON GAME? 23 
TEAM 1 PLAY CHART 
NO. PLAV 



17 


PITCHOUT 


8 


TRIPLE REVERSE 


4 


DRAW 


14 


QB SNEAK 


19 


END AROUND 


■j 


DOUBLE REVERSE 


10 


LEFT SWEEP 


1 


RIGHT SWEEP 


7 


OFF TACKLE 


11 


WISHBONE OPTION 


15 


FLARE PASS 


9 


SCREEN PASS 


5 


ROLL OUT OPTION 


28 


RIGHT CURL 


13 


LEFT CURL 


18 


WISHBONE OPTION 


■16 


SIDELINE PASS 


2 


HALF-BACK OPTION 


12 


RRZZLE 'DAZZLE 


6 


BOMB 1 !!!!!!! 



TEAR OFF HERE 



TEAM 2 DOWN 2 ON 79 6 YARDS TO 1ST DOWN 

TEAM 1 [0 18 28 38 48 58 62 78 8 

INPUT OFFENSIVE PLAY, DEFENSIVE PLAY? s,2 

PASS INCOMPLETE TEAM 2 

NET YARDS GAINED ON DOWN 2 ARE 8 

TEAM 2 DOWN 2 ON 79 6 YARDS TO 1ST DOWN 

TEAM 1 [0 18 28 38 48 58 62 78 8 

I H P U T F F E N S I V E P L A Y , D E F E N S I V E P L fl V ? 8 , 1 8 

THE BALL WAS RUN 

NET YARDS GAINED ON DOWN 3 ARE 8 



188 3 TEAM 2 



TEAM 2 DOWN 1 ON 71 

TEAM 1 [8 18 28 30 48 58 

INPUT OFFENSIVE PLAY, DEFENSIVE PLA 

QUARTERBACK SCRAMBLED 

NET YARDS GAINED ON DOWN 1 ARE 8 



18 YARDS TO 1ST DOWN 



188 3 TEAM 



188 3 TEAM 



EfiM 


2 PLAY CHART 


0. 


PLAV 


28 


PITCHOUT 


2 


TRIPLE REVERSE 


17 


DRAW 


5 


QB SNEAK 


8 


END AROUND 


18 


DOUBLE REVERSE 


12 


LEFT SWEEP 


11 


RIGHT SWEEP 


1 


OFF TACKLE 


4 


WISHBONE OPTION 


19 


FLARE PASS 


14 


SCREEN PASS 


10 


ROLL OUT OPTION 


7 


RIGHT CURL 


9 


LEFT CURL 


15 


WISHBONE OPTION 


s 


SIDELINE PASS 


13 


HALF-BACK OPTION 


16 


RAZZLE DAZZLE 


3 


BOMB !!!'?'!) 



TEAR OFF HERE 



TEAM 2 DOWN 2 ON 71 18 YARDS TO 1ST DOWN 

TEAM 1 [8 18 28 38 4 8 58 62 78 22 

I N P U T F F E N S I V E PLA V , D E F E N S I V E PLA Y ? 1 ;3 , 1 8 

THE BALL WAS RUN 

NET YARDS GAINED ON DOWN 2 ARE 4 

TEAM 2 DOWN 3 ON 67 6 YARDS TO 1ST DOWN 

TEAM 1 C8 18 28 38 48 58 62 78 88 

INPUT OFFENSIVE PLAY, DEFENSIVE PLRY?' ?, 17 

PASS COMPLETED 

NET YARDS GAINED ON DOWN 3 ARE 18 

TEAM 2 DOWN 1 ON 49 18 YARDS TO 1ST DOWN 

TEAM 1 [@ 18 28 38 48 58 68 78 88 

INPUT OFFENSIVE PLAY, DEFENSIVE PLAY? 2,9 

PASS INCOMPLETE TEAM 2 

NET YARDS GAINED ON DOWN 1 ARE 8 



188 3 TEAM 2 



188 3 TEAM 2 



TEAM 2 DOWN 2 ON 49 18 YARDS TO 1ST DOWN 

TEAM 1 C8 18 20 30 40 50 60 78 88 

I N P U T F F E N S I V E P L AY , D E F E N S I V E P L A Y ? 3 , 1 8 

PASS INCOMPLETE TEAM 2 

NET YARDS GAINED ON DOWN 2 ARE 8 



188 3 TEAM 2 



TEAM 2 DOWN 3 ON 49 18 YARDS TO 1ST DOWN 

TEAM 1 C 8 18 20 30 48 58 60 70 80 

INPUT OFFENSIVE PLAV, DEFENSIVE PLAY? 3,11 

PASS INCOMPLETE TEAM 2 

NET YARDS GAINED ON DOWN 2 ARE 



108 3 TEAM 2 



105 



FURS 



FUR TRADING EXPEDITION 



Description 



You are the leader of a French fur trading expedition in 1776 
leaving the Ontario area to sell furs and get supplies for the 
next year. You have a choice of three forts at which you may 
trade. The cost of supplies and the amount you receive for your 
furs will depend upon the fort you choose. You also specify 
what types of furs that you have to trade. 

The game goes on and on until you elect to trade no longer. 

Source 



Thanks to Ann Brebner for sending us the program, 
originally written by: 

Dan Bachor 

Dept. of Educational Psychology 
University of Calgary 
Calgary, Alberta, Canada 



It was 




"Ah, here's your guide now.' 

106 



1962 by The New Yorker Magazine, Inc. 



PROGRAM LISTING 



MANY "*B$J" PELyS DO YOU HAvfc'M 



1 DIM FC4) 

2 RANDOM 

15 GOSUB 1091 

16 LET 1*600 

17 PRINT "DO YOU WISH TO TRADE FURS?" 

18 GOSUB 1402 

19 ip B$s»YES" THEN 100 

20 IF B$«"NO" THEN 2200 
25 GOSUB 1402 
100 PRINT 

10i PRINT "YOU HAVE $">I "SAVINGS," 
102 PRINT "AND 190 FURS TO BEGIN THE EXPEDITION," 

300 PRINT 

301 print "y0|jr 190 furs are distributed among t he following" 

302 Print "kinds of pelts* mink, beaver, ermine and fox,» 

310 GOSUB 1430 

315 RESTORE 

330 FOR J*l TO 4 

332 READ B$ 

333 PRINT 
335 PRINT "HO* 
338 INPUT F(J) 
340 LET F(0)«F(1)+F(2)+F(3)+F(4) 
342 IF F(0)«190 THEN 1100 

344 IF F(0J>190 THEM 500 
348 NEXT J 
350 GO TO 1100 

500 PRINT 

501 PRINT "YOU MAY NOT HAVE THAT MANY FURS," 

502 PRINT "DO NOT TRY TO CHEAT, I CAN ADD," 

503 PRINT hYOU MUST START AGAIN," 

504 GO TO lb 
508 PRINT 

5ii print «do you wan t to trade furs next year?" 

513 GO TO 18 

1091 prInT "YqU ArE THE LEADER qF A FrEnCH fur trading expedition In " 

1092 PRINT "1776 LEAVING THE t,A K E OnTARIq AREA TO SELL FURS A N D GET" 

1093 PRINT "SUPPLIES FOR ThE NEXT YEAR, YOU HAVE A ChOiCE OF ThREE" 

1094 PRINT "fORTS AT WHICH YOU MAY TRADe, THE COST Op SUPPLIES" 

1095 PRINT "AND THE AMOUNT YOU RECEIVE FOR YOUR FURS WILL DEPEND" 

1096 PRINT "ON THE FORT THAT YOU CHOOSE." 

1099 RETURN 

1100 PRINT "00 YOU WANT TO TRADE YOUR FURS AT FORT i, FORT 2," 

1102 PRINT "OR FORT 3? FORT 1 IS FORT HOCHELAGA (MONTREAL)" 

1103 PRINT "AND IS UNDER THE PROTECTION OF THE FRENCH ARMY," 

1104 PRINT "FORT 2 IS FORT STADACONA (QUEBEC) AND IS UNDER THE" 

1105 PRINT "PROTECTION OF THE FRENCH ARMY. HOWEVER, YOU MUST" 

1106 PRINT "MAKE A PORTAGE AND CROSS THE LACHINE RAPIDS," 

1108 PRINT "FORT 3 IS FORT NEW YORK AND IS UNDER DUTCH CONTROL." 

1109 PrINt "YOU M UST CROSS THrOuGH IrOQuOIs LAND," 

1110 PrINt "ANSWER 1, 2, Or 3," 

1111 INpUT 6 

1112 IF B*l THEN 1120 

1113 IF 8*2 ThEn 1135 

1115 IF B»3 THEN 1147 

1116 GO TO 1110 

1120 PRINT "YOU HAVE CHOSEN THE EASIEST ROUTE. HOWEVER, THE FORT" 

1121 PRINT "IS FAR PROM ANY SEAPORT. THE VALUE" 

1122 PRINT "YOU RECEIVE FOR YOUR FURS WILL BE LOW AND THE COST" 

1123 PRINT "OF SUPPLIES HIGHER THAN AT FORTS STADACONA OR NEW YORK,m 
1125 GOSUB 1400 

1129 IF BS*»YtS« THEN 1H0 

1130 GOTO 1160 

1135 PRINT "YOU HAVE CHqsEn A HARD ROUTE, IT IS, In CoMPARSlON," 

1136 PRINT "HARDER THAN THE ROUTE TO HoCHELAGA BUT EASIER THAN" 

1137 PRINT "THE ROUTE TO nEW YORK. YOU WI L l RECEIVE AN AVERAGE VALUE" 

1138 print "for your furs and the cost of your supplies will be average" 

1141 GOSUB 1400 

1144 IF B$*"YES" THEN 1110 

1145 GOTO 1198 

1147 PRINT "YOU HAVE CHOSEN THE MOST DIFFICULT ROUTE, AT" 

114 8 PRINT "FORT NEW YORK YOU WILL RECEIVE THE HIGHEST VALUE" 

1149 PRINT "FOR YOUR FURS. THE COST OF YOUR SUPPLIES" 

1150 PRINT "WILL BE LOWER THAN AT ALL THE OTHER FORTS," 
U52 GOSUB 14PI0 

1155 IF B$s"YES" THEN 1110 

1156 GOTO 1250 
1160 LET 1*1-160 
1169 PRINT 

1174 L ET m1»INT((,2*RnD(0)+,7)*100+. 5J/100 

1175 LET E1 8 INTCC.2*RND(0)+.65)*10a2+,5}/10a2 

1176 LET B1*INT((,2*RND(0)+,75)*10a2+,5)/10a2 

1177 LET D1sINT((.2*RnD(0)+.80)*18a2+.5)/10a2 

1180 PRINT "SUPPLIES AT FORT HOCHELAGA COST $150.00" 

1181 PRINT "YOUR TRAVEL EXPENSES TO HOCHELAGA WERE $10.00" 



1190 
1198 

1201 
1205 
1206 
1207 
1209 
12-10 
1212 
1213 
1215 
1216 
1218 
1219 
1220 
1221 
1222 
122 4 
1225 
1226 
1230 
1231 
1232 
1233 
1235 
1237 
1238 
1239 
1240 
1244 
1246 
1248 
1250 
1254 
1260 
1261 
1262 
1263 
1270 
1271 
1272 
1273 
1274 
1281 
1282 
1283 
1284 
1291 
1292 
1293 
1295 
1300 
1301 
1303 
1304 
1306 
1307 
1308 
1309 
1311 
1312 
1320 
1322 
1400 
1402 
1403 
1404 
1410 
U12 
1414 
1416 
1417 
1418 
1420 
1422 
1425 
1430 
1432 
1434 
1436 
2000 
2046 
2200 
2210 
2220 



GO TO 
LET !■ 

PRINT 

LET Ml 

LET El 

LET Bl 

LET P« 

IF P<* 

IF P<* 

IF P<* 

IF P<* 

LET F( 

PRINT 

PRINT 

PRINT 

GOSUB 

GO TO 

PRINT 

GO TO 

GOSUB 

PRINT 

PRINT 

GOSUB 

GO TO 

LET F( 

PRINT 

PRINT 

GOSUB 

GO TO 

PRINT 

PRINT 

RETURN 

LET I* 

PRINT 

LET Ml 

LET El 

LET Bl 

LET 01 

LET P* 

IF P<» 

IF P<* 

IF P<* 

IF P<* 

PRINT 

PRINT 

PRINT 

STOP 

PRINT 

PRINT 

GO TO 

GOSUB 

PRINT 

PRINT 

GOSUB 

GO TO 

LET Bl 

LET Ml 

PRINT 

PRINT 

GOSUB 

GO TO 

PRINT 

RETURN 

PRINT 

PRINT 

INPUT 

RETURN 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

LET I* 

PRINT 

Print 

GO TO 
FOR J* 
LET F( 
NEXT J 
RETURN 
DATA 
END 
PRINT 
PRINT 

print 



1410 

1-140 

■INT((.3*RnD(0)+,85)*10a2+,5)/10a2 

«INT((.15*RN D (0)+ t 80)*10A2+,5)/10A2 

■INT((,2*RND(0)+,90)*10a2+.5)/10a2 

INT(10*RND(O0))+l 

2 THEN 1216 

6 THEN 1224 

8 THEN 1226 

10 THEN 1235 

2)*0 

"YOUR BEAVER WERE TOO HEAVY TO CARRY ACROSS" 

"ThE PORTAGE, YOU hAD TO LEAVE ThE PElTS BUT FOUND" 

"ThEm STOLEN WhEN YOU RETURNED" 

1244 

1414 

"YOU ARRIVED SAFELY AT FORT STADACONA" 

1239 

1430 

"YOUR CANOE UPSET IN THE LACHINE RAPIDS. YOU" 

"LOST ALL YOUR FURS" 

1244 

1*18 

4)«0 

"YOUR FOX PElTS WERE NOT CURED PROPERLY, " 

"NO ONE WILL BUY THEM," 

1244 

1410 

"SUPPLIES AT FORT STADACONA COST $125,00" 

"YOUR TRAVEL EXPENSES TO STADACONA WERE $15,00" 

1-105 

■INT (C.i5*RND(0) +1.05) *10A2*,5)/10A2 

*INT((,15*RND(0)+,95)*10A2+.5)/10A2 

»INT((,25*RND(0)+1,00)*10a2 + ,5)/10a2 

*INT((,25*RND(0)+1,10)*10a2+.5)/10a2 

INT(10*RND(0))-fl 

2 THEN 1281 

6 THEN 1291 

6 THEN 1295 

10 THEN 1306 

"YOU WERE ATTACKED BY A PARTY OF IROQUOIS," 

"ALL PEOPLE IN YOUR TRADING GROUP WERE" 

"KILLED, THIS ENDS THE GAME," 

"YOU WERE LUCKY, YqU ArrIVED SAFELY" 

"at fort new y rk." 

1311 
1430 

"you narrowly escaped an iroquois raiding party." 

"HOWEVER, YOU HAD TO LEAVE ALL YOUR FURS BEHIND," 

1320 

1418 

■Bl/2 

■Ml/2 

"YOUR MINK AND BeAVeR WERE DAMAGED ON YOUR TRIP." 

"you receive only half the current price for these furs. 

1320 
14 10 
SUPPLIES AT NEW YORK COST $80. $0" 

"00 YOU WANT TO TRADE AT ANOTHER FORT?" 

"ANSWER YES OR NO", 

BS 



"YOUR BEAVER SOLD FOR $«>B1*F(2); 
"YOUR FOX SOLD FOR $"iOl*F(4) 
"YOUR ERMINE SOLD FOR S«|El*FC3)l 
"YOUR MINK SOLD FOR $"|Ml*F(l) 
Ml*F ( i)*Bl*F(2j + El*Fc3)+01#F(4)*I 

"YOU MOw HAVE $"?!?« INCLUDING YOUR PREVIOUS SAVINGS" 

508 

1 TO 4 

J)*0 



MINK", "BE AVER", "ERMINE "."FOX" 



YOu ENDED YOuR F-jjR fRADING ' wI'TK $"I«, 
HOPE YOu ENJOYED YOURSELFl" 



107 



SAMPLE RUN 



VOU ARE THE LEADER OF ft FRENCH FUR TRADING- -EXPEDITION IN 
1776 LEAVING THE LAKE ONTARIO AREA TO SELL FURS AND GET 
SUPPLIES FOR THE NEXT VEftR. VOU HftVE ft CHOICE OF THREE 
FORTS AT WHICH VOU MAY TRADE. THE COST OF SUPPLIES 
AND THE AMOUNT VOU RECEIVE FOR YOUR FURS WILL DEPEND 
ON THE FORT THAT VOU CHOOSE. 
DO VOU WISH TO TRADE FURS? . 
ANSWER VES OR NO ? YES 

VOU HftVE $ 60@ SAVINGS. 

AND 190 FURS TO BEGIN THE EXPEDITION. 

VOUR 190 FURS ARE DISTRIBUTED AMONG THE FOLLOWING- 
KINDS OF PELTS: MINK, BEAVER, ERMINE AND FOX. 

HOW MANV MINK PELTS DO VOU HAVE? 50 

HOW MANY BEAVER PELTS DO VOU HAVE? 4© 

HOW MANV ERMINE PELTS DO VOU HAVE? 50 

HOW MANV FOX PELTS DO VOU HAVE? 50 

DO VOU WANT TO TRADE VOUR FURS AT FORT 1, FORT 2, 

OR FORT 3? FORT 1 IS FORT HOCHELAGA (MONTREAL) 

AND IS UNDER THE PROTECTION OF THE FRENCH ARMY. 

FORT 2 IS FORT STADACONA (QUEBEC) AND IS UNDER THE 

PROTECTION OF THE FRENCH ARMY. HOWEVER, VOU MUST 

MAKE A PORTAGE AND CROSS THE LACHINE RAPIDS. 

FORT 3 IS FORT NEW YORK AND IS UNDER DUTCH CONTROL. 

YOU MUST CROSS THROUGH IROQUOIS LAND. 

ANSWER 1, 2, OR 3. 

? 3 

VOU HAVE CHOSEN THE MOST DIFFICULT ROUTE. AT 

FORT NEW YORK VOU WILL RECEIVE THE HIGHEST VALUE 

FOR VOUR FURS. THE COST OF VOUR SUPPLIES 

WILL BE LOWER THAN AT ALL THE OTHER FORTS. 

DO VOU WANT TO TRADE AT ANOTHER FORT? 

ANSWER VES OR NO ? NO 

VOU NARROWLY ESCAPED AN IROQUOIS RAIDING PARTY. 
HOWEVER, VOU HAD TO LEAVE ALL VOUR FURS BEHIND. 
SUPPLIES AT NEW YORK COST $80. 00 

YOU NOW HAVE * 495 INCLUDING YOUR PREVIOUS SAVINGS 

DO YOU WANT TO TRADE FURS NEXT YEAR? 
ANSWER VES OR NO ? VES 

VOU HAVE $ 495 SAVINGS. 

AND 190 FURS TO BEGIN THE EXPEDITION. 

YOUR 190 FURS ARE DISTRIBUTED AMONG THE FOLLOWING 
KINDS OF PELTS: MINK, BEAVER, ERMINE AND FOX. 

HOW MANV MINK PELTS DO VOU HAVE? 50 

HOW MftNV BEftVER PELTS DO VOU HftVE? 40 

HOW MftNV ERMINE PELTS DO YOU HftVE? 50 

HOW MANV FOX PELTS DO VOU HAVE? 50 

DO YOU WANT TO TRADE VOUR FURS AT FORT 1, FORT 2, 

OR FORT 3? FORT 1 IS FORT HOCHELAGA (MONTREAL) 

AND IS UNDER THE PROTECTION OF THE FRENCH ARMV. 

FORT 2 IS FORT STADACONA (QUEBEC) AND IS UNDER THE 

PROTECTION OF THE FRENCH ARMY. HOWEVER, YOU MUST 

MAKE A PORTAGE AND CROSS THE LACHINE RAPIDS. 

FORT 3 IS FORT NEW YORK AND IS UNDER DUTCH CONTROL. 

YOU MUST CROSS THROUGH IROQUOIS LAND. 

ANSWER 1, 2, OR 3. 

? 2 

YOU HAVE CHOSEN A HARD ROUTE. IT IS, IN COMPARSION, 

HftRDER THAN THE ROUTE TO HOCHELFlGA BUT EASIER THAN. 

THE ROUTE TO NEW YORK. YOU WILL RECEIVE AN AVERAGE VALUE 

FOR YOUR FURS AND THE COST OF YOUR SUPPLIES WILL BE AVERAGE 

DO VOU WANT TO TRADE AT ANOTHER FORT? 

ANSWER VES OR NO ? NO 

VOUR FOX PELTS WERE NOT CURED PROPERLY. 

NO ONE WILL BUY THEM. 

SUPPLIES AT FORT STADACONA COST $125.00 

YOUR TRAVEL EXPENSES TO STADACONA WERE $15. O© 

VOUR BEAVER SOLD FOR $ 40.4 VOUR FOX SOLD FOR $ 
VOUR ERMINE SOLD FOR $ 46 VOUR MINK SOLD FOR $ 46. 5 



DO VOU WANT TO TRADE FURS NEXT VEAR? 
ANSWER VES OR NO ? VES 

YOU HAVE * 487.9 SAVINGS. 

AND 190 FURS TO BEGIN THE EXPEDITION. 

YOUR 190 FURS ARE DISTRIBUTED AMONG THE FOLLOWING 
KINDS OF PELTS: MINK, BEAVER, ERMINE AND FOX. 

HOW MANV MINK PELTS DO VOU HAVE? 60 

HOW MANV BEAVER PELTS DO VOU HAVE? 50 

HOW MANV ERMINE PELTS DO VOU HAVE? 40 

HOW MANY FOX PELTS DO YOU HAVE? 40 

DO YOU WANT TO TRADE YOUR FURS AT FORT 1, FORT 2, 

OR FORT 3? FORT 1 IS FORT HOCHELAGA (MONTREAL) 

AND IS UNDER THE PROTECTION OF THE FRENCH ARMY. 

FORT 2 IS FORT STADACONA (QUEBEC) AND IS UNDER THE 

PROTECTION OF THE FRENCH ARMY. HOWEVER, VOU MUST 

MAKE A PORTAGE 'AND CROSS THE LACHINE RAPIDS. 

FORT 3 IS FORT NEW YORK AND IS UNDER DUTCH CONTROL. 

YOU MUST CROSS THROUGH IROQUOIS LAND. 

ANSWER 1, 2, OR 3. 

? 3 

VOU HAVE CHOSEN THE MOST DIFFICULT ROUTE. AT 

FORT NEW YORK YOU WILL RECEIVE THE HIGHEST VALUE 

FOR VOUR FURS. THE COST OF VOUR SUPPLIES 

WILL BE LOWER THAN AT ALL THE OTHER FORTS. 

DO VOU WANT TO TRADE AT ANOTHER FORT? 

ANSWER VES OR NO ? NO 

VOUR MINK AND BEAVER WERE DAMAGED ON YOUR TRIP. 

YOU RECEIVE ONLV HALF THE CURRENT PRICE FOR THESE FURS. 

SUPPLIES AT NEW YORK COST $80. 00 



VOUR BEAVER SOLD FOR 
VOUR ERMINE SOLD FOR 



YOU NOW HAVE $ 535. 



$ 28 VOUR FOX SOLD FOR $ 46 
$ 43. 6 VOUR MINK SOLD FOR $ 



INCLUDING YOUR PREVIOUS SAVINGS 



DO VOU WANT TO TRADE FURS NEXT YEAR? 
ANSWER VES OR NO ? VES 

VOU HAVE $ 535. 6 SAVINGS. 

AND 190 FURS TO BEGIN THE EXPEDITION. 

VOUR 190 FURS ARE DISTRIBUTED AMONG THE FOLLOWING 
KINDS OF PELTS: MINK, BEAVER, ERMINE AND FOX. 

HOW MANV MINK PELTS DO VOU HAVE? 50 

HOW MANV BEAVER PELTS DO VOU HAVE? 40 

HOW MANV ERMINE PELTS DO VOU HAVE? 50 

HOW MANV FOX PELTS DO VOU HAVE? 50 
DO VOU WANT TO TRADE VOUR FURS AT FORT 1, FORT 2, 
OR FORT 3? FORT 1 IS FORT HOCHELAGA (MONTREAL) 
AND IS UNDER THE PROTECTION OF THE FRENCH ARMV. 
FORT 2 IS FORT STADACONA (QUEBEC) AND IS UNDER THE 
PROTECTION OF THE FRENCH ARMV. HOWEVER, VOU MUST 
'MAKE A PORTAGE AND CROSS THE LACHINE RAPIDS. 
FORT 3 IS FORT NEW YORK AND IS UNDER DUTCH CONTROL. 
VOU MUST CROSS THROUGH IROQUOIS LAND. 
ANSWER 1, 2, OR 3. 
? 1 

YOU HAVE CHOSEN THE EASIEST ROUTE. HOWEVER, THE FORT 
IS FAR FROM ANY SEAPORT. THE VALUE 

YOU RECEIVE FOR VOUR FURS WILL BE LOW AND THE COST 
OF SUPPLIES HIGHER THAN AT FORTS STADACONA OR NEW YORK. 
DO YOU WANT TO TRADE AT ANOTHER FORT? 
ANSWER YES OR NO ? NO 

SUPPLIES AT FORT HOCHELAGA COST $150.00 

YOUR TRAVEL EXPENSES TO HOCHELAGA WERE $10. 00 

YOUR BEftVER SOLD FOR $ 32. 8 YOUR FOX SOLD FOR $ 49. 5 
VOUR ERMINE SOLD FOR $ 36 VOUR MINK SOLD FOR $ 42.5 

VOU NOW HAVE $ 536.4 INCLUDING VOUR PREVIOUS SAVINGS 

DO YOU WANT TO TRADE FURS NEXT YEAR? 
ANSWER YES OR NO ? NO 



VOU NOW HAVE $ 487 



INCLUDING VOUR PREVIOUS SAVINGS 



108 



GOLF 



18 HOLES OF GOLF 



Description 



Up to four players may play up to 18 holes of golf. The length 
of each hole and par are given to the players. Each player 
chooses a club and the computer determines the results of the 
shot. A player can duff a shot or get a hole in one. There 
are also water hazards , rough, and sand traps. Note: It is 
sometimes very difficult to chip out of a sand trap. 

Computer Limitations 

This version of GOLF was written for a DIGITAL EduSystem 30; 
however, Statements 140 and 150 are the only ones unique to 
that system and may be easily changed. When using EduSystem 30, 
the NOLINE command must be given before running. 

Program Author 

There are several good one-player golf games. Paul Raymond 
of College St. Laurent, Quebec, submitted one and another 
has been around DIGITAL for years* However, this is the 
best multi-player version we've seen. Available from DECUS 
as BASIC 8-560, it was written by: 

Howard Kargman 

194 King Philip Drive 

West Hartford, CT 06117 







t 






^ 



*&&gsj%^Jigl^ : 3fgg&$. 



1 966 by The Curtis Publishing Co. 



109 



PROGRAM LISTING 



180RANDOMI2E 

110DINX<20>. 

120PRINT"DO VOU WANT DIRECTIONS V FOR YES N FOR r 

130INPUT*Z\PRINT 

140IFZ=#YTHEN160 

150IFZ=#NTHEN290 

160PRINT"DIRECTIONS FOR GOLF" 

170PRINT 

180PRINT"VOU HAVE ft CHOICE OF 9 CLUBS" 

190PRINT"WHEN THE COMPUTER TELLS VOU TO CHOSE 

200PRINT" INPUT 1 FOR fl DRIVER RANGE OF 150 T 



fl 5 



2:10PRINT"INPUT 2 FOR 
220PRINT"INPUT 3 FOR 
230PRINT"INPUT 4 FOR fl 
24 @PR I NT "INPUT 5 FOR fl 
250PRINT" INPUT 6 FOR fl 
260PRINT"INPUT 7 FOR fl 
270PRINT" INPUT 
280PRINT" INPUT 9 FOR fl PUTTER 



WOOD- 
IRON 
IRON 
IRON 
IRON 
IRON 
FOR fl WEDGE 



VOUR CLUB" 
278 VflRDS" 
220 VflRDS" 



GOOD FROM 
GOOD FROM 
GOOD FROM 
GOOD FROM 
GOOD FROM 



PLAVERS ARE PLAYING TODAY" .; M NPUTUXPRT NT 



RANGE OF ISO T 
RANGE OF 140 TO 180 YARDS 
RANGE OF 120 TO ISO YARDS 
RANGE OF 100 TO 130 YARDS 
RANGE OF 70 TO 1O0 YARDS 
RANGE OF 30 TO 70 YARDS 
RANGE UP TO 30 VflRDS 
USE WHEN ON GREEN" 

290PRINT 

380PRINT"HOW MAN 

310IFU-O4THEN340 

320PRINT"ONLV FOUR ARE ALLOWED TO PLAY AT ONE TIME" 

330GOTO300 

340PRINT 

350DATA36O, 4, 585, 5.. 400, 4, 185, 3, 415, 4, 375, 4, 219, 3 

360DATA395, 4, 638, 5, 330, 4, 610, 5, 440, 4, 180, 3, 420, 4, 595, 5, 195, 3 

3,'0DflTfl450,4, 370,4 

380DIMFK18) 

390DIMP<18) 

400FORR=1TO18 

410REflDfl'::R>SREflDP<R> 

428NEXTR 

430DIM M<4, 18 > 

440DIMN<10) 

450PRINT"HOW MANY HOLES UP TO 18 DO VOU WANT TO PLAY? " \ INPUTV 

460PRINT 

470FORJ=1TO V 

480FOR G = 1T0 U 

490LETH=A <J) 

500PR I NT "HOLE NUMBER " i J ; "IS " ; H; " YARDS PAR " .; P ( J ) 

510LETK=0 

520LETT=0 

530LET T2=0 

5 4 P R I N T " P L fi V E R N U M B E R " ; Q ; " C HOSE V U R C L U B " 
550 INPUT X 

560IFX=9THEN888 ' 

570LETK=K+1 

S80 IF X = 9 THEN 338 

590GOTO134O 

600IFX=9THEN97O 

610LETD=X 

iS20IFHOX<D>THEN630MFKOlTHEN990\PRINT"HOLE IN ONE! ! !"\GOTO990 

630PRINT"DISTflNCE OF SHOT I S ".; X<D >.; "VflRDS" 

640LETL= I NT < RND < X > +100 > 

650IFL = 99THEN670XIFL = 43THEN670\IFt. = 88THEN670 

668IFLO25THEN760 

6 7 O P R I N T " I N T R fl P " \ L E T C = fl B S ( H - X < D > ) \ G T 6 8 2 
i580LETL8=INT':RND':K)+10> 
690IFL8>3THEN680\IFL8=1THEN850 
700LETT2=0 

710FORZ=1TOL8 
729LETT2=T2+1 

7 3 P R I N T " C H S E V U R C L U B " S I N P U T X 
740PRINT"STILL IN TRflP"'\NEXT2 
750GOTO850 

7S0IFL=13THEN780\IFL=88THEN780 
770IFLO25THEN8O0 

7 8 P R I N T "IN R U G H " X L E T C = fl B S < H - X < D ) > \ G T 8 5 8 

790IFL=69THEN810\IFL=73THEN810\IFL=41THEN810 

800IFLO75THEN 838 

818PR I NT "IN WATER " \LETT=T+1\PR INT" VO 

820GOTO850 

830LETC=flBS<H-X<D>> 

840IFC-C38THEN930 

850PR:[NT"DISTANCE REMAINING TO PIN IS".;C 

86@LETH=C 

870GOTO54O 

880LETC = fl.::,J> 

8.90IFO3OTHEN910 

988GOTO970 

910PRINT"VOU ARE NOT ON THE GREEN CHOSE ANOTHER CLUB 

920GOTO550 

930PRINT"PLAYER NUMBER"; G.; " IS ON THE GREEN CHOSE 

940INPUTX 

950LETD=X 

960GOTO590 

970PRINT X-::D> "PUTTS" 

988LETM<G, J > =K + X <9 > + T + T2\GOTO100O 

990LETM<G, J >=KSPR INT " VOU SUNK THE SHOT" 

■X P R I N T M < Q , J > " S T R K E S F R HOLE N U M B E R " ; J ; " F R P L A V E R " .; G 

1 1 8 N E X T G \ PRINT \ P R I N T 

1028NEXT J 

1030FORW=1TOV 

1040LETN<1> = M<1, W) + N<1) 

1050LETNC2)=M<2, W> + N<2> 

1060LETN<3> = M(3, W>+N(3) >v 

1870LETN<4) = M<4, W) + N<4) 

1080LET E= P<W)+E 

1090NEXTW 

1100FORS=1TOU - 

:1:110PR I NT " PLAYER NUMBER " .; S; " SHOT" ; N ( S ) ; "FOR " 

1120NEXT S 

1130GOTO1440 

1140LETX«:2) = INT<130*RND<X) + 150X 

1150GOTO600 

1160LETX<1)=INT<90+RND<X>+180> 

1170GOTO600 

1180LETX<i3>=TNT<40*RNDfX> + 140) 

1190GOTO60O 

1200LETX<4)=INT(60+RND(X>+120) 

1210GOTO60O 

1220LETX<5)=INT<30+RND<X>+100> 

1230GOTO680 

;1240LETX<6> = INTc30+RND(X) + 70> 

1250GOTO600 

1268LETX < 7 > = I NT < 40*RND < X > + 30 ) 

127OGOTO600 

1280LETX < 8 > = I NT < 38 + RND < X ) + 1 > 

1290IFX<8X1THEN1280 . 



ROUGH" 

ROUGH" 

TRAP" 

TRAP" 

TRAP" 



LOSE 1 STROKE"\LETC=ABS<H-X(D>> 



"YARDS" 



VOUR CLUB" 



"HOLES PAR IS" 



INPUT 


1 


FOR 


A 


DRIVER 


INPUT 


2 


FOR 


A 


3 WOOD 


INPUT 


3 


FOR 


A 


5 IRON 


INPUT 


4 


FOR 


A 


6 I-RON 


INPUT 


5 


FOR 


A 


7 IRON 


INPUT 


6 


FOR 


A 


8 IRON 


INPUT 


7 


FOR 


A 


9 IRON 


INPUT 


8 


FOR 


A 


WEDGE 


INPUT 


9 


FOR 


A 


PUTTER 



110 



1300GOTO60O 

1310LETX < 9 > = I NT < 3 + RND ( X ) + 1 ) 

1320GOTO600 

1330STOP 

1340IFX = 1THEN1160 ,; - 

1350IFX=2THEN1140 

1360IFX=3THEN1180 

1370IFX=4THEN1200 

1380fFX=5THEN1220 

1390IFX=6THEN1240 

1400IFX=7THEN1260 

:1410IFX = 8THEN1280 

1420IFX=9THEN1310 

1430GOTO680 

1440END 



SAMPLE RUN 

DO VOU WANT D I RECT I ONS Y FOR YES N FOR NO 

V ' 

DIRECTIONS FOR GOLF 

VOU HAVE A CHOICE OF 9 CLUBS 

WHEN THE COMPUTER TELLS YOU TO CHOSE YOUR CLUB 

RANGE OF 150 TO 270 YARDS 

RANGE OF 150 TO 220 YARDS 

RANGE OF 140 TO 180 YARDS 

RANGE OF 120 TO 188 YARDS 

RANGE OF 100 TO 130 YARDS 

RANGE OF 70 TO 100 VflRDS 

RANGE OF 30 TO 78 VflRDS 

RANGE UP TO 38 VflRDS 

USE WHEN ON GREEN 

HOW MANY PLAYERS ARE PLAYING TODAY?! 



HOW MANV HOLES UP TO 18 DO VOU WANT TO PLAY?. 
?5 

HOLE NUMBER 1 IS 368 YARDS PAR 4 

PLAYER NUMBER 1 CHOSE VOUR CLUB 

->1 

DISTANCE OF SHOT IS 184 YARDS 

DISTANCE REMAINING TO PIN IS 176 YARDS 

PLAYER NUMBER 1 CHOSE VOUR CLUB 

?2 

DISTANCE OF SHOT IS 262 YARDS 

DISTANCE REMAINING TO PIN IS 86 YARDS 

PLAYER NUMBER 1 CHOSE YOUR CLUB 

16 

DISTANCE OF SHOT IS 79 YARDS 

PLAYER NUMBER 1 IS ON THE GREEN CHOSE VOUR CLUB 

?9 ■ ■ 

3 PUTTS 

6 STROKES FOR HOLE NUMBER 1 FOR PLAYER 1 



HOLE NUMBER 2 IS 585 YARDS PAR 5 

PLAVER NUMBER 1 CHOSE VOUR CLUB 

71 

DISTANCE OF SHOT IS 225 YARDS 

IN TRAP 

DISTANCE REMAINING TO PIN IS 360 VflRDS 

PLAVER NUMBER 1 CHOSE VOUR CLUB 

76 

DISTANCE OF SHOT IS 88 VflRDS 

DISTANCE REMAINING TO PIN IS 272 VflRDS 

PLAVER NUMBER 1 CHOSE VOUR CLUB 

71 

DISTANCE OF SHOT IS 232 VflRDS 

DISTANCE REMAINING TO PIN IS 40 YARDS 

PLAVER NUMBER 1 CHOSE VOUR CLUB 

7 7 

DISTANCE OF SHOT IS 33 VflRDS 

PLAVER NUMBER 1 IS ON THE GREEN CHOSE VOUR CLUB 

79 

3 PUTTS 

7 STROKES FOR HOLE NUMBER 2 FOR PLAVER l" 



HOLE NUMBER 3 IS 400 YARDS PAR 4 
PLAVER NUMBER 1 CHOSE VOUR CLUB 
71 

DISTANCE OF SHOT IS 236 YARDS 
DISTANCE REMAINING TO PIN IS 164 VflRDS 
PLAYER NUMBER 1 CHOSE VOUR CLUB 
.75 

DISTANCE OF SHOT IS 102 YARDS 
DISTANCE REMAINING TO PIN IS 62 YARDS 
PLAVER NUMBER 1 CHOSE VOUR CLUB 

DISTANCE OF SHOT; IS 5© YARDS 

PLAVER N U M BE R .1 IS N THE GREEN C HOSE V U R C L U B 
•79 

:."i putts' ■.'"■■„. 

. 4 STROKES FOR HOLE NUMBER 3 FOR PLAVER 1 



HOLE NUMBER 4 IS 185 YARDS PAR 3 

PLAVER NUMBER 1 CHOSE VOUR CLUB 

.72 

DISTANCE OF SHOT IS 182 YARDS 

PLAVER NUMBER 1 IS ON THE GREEN CHOSE VOUR CLUB 
-.79' *' • * "'. '; - 

"■ 3 PUTTS : v 

4 STROKES FOR HOLE NUMBER 4 FOR PLAVER 1 



HOLE NUMBER 5 IS 415 YARDS PAR 4 

PLAVER NUMBER 1 CHOSE VOUR CLUB 

71. 

DISTANCE OF SHOT IS 218 VflRDS 

DISTANCE REMAINING TO PIN IS 205 VflRDS 

PLAYER NUMBER 1 CHOSE VOUR CLUB 

72 

DISTANCE OF SHOT IS 208 YARDS 

PLAVER NUMBER 1 IS ON THE GREEN CHOSE VOUR CLUB 

79 

3 PUTTS 

5 STROKES FOR HOLE NUMBER 5 FOR PLAVER 1 



GOOD FROM ROUGH 
GOOD FROM ROUGH 
GOOD FROM TRAP 
GOOD FROM TRAP 
GOOD FROM TRAP 



GOMOKO 



ORIENTAL GAME OF GO-MOKO 



Description 



GO-MOKO is a traditional game of the Orient. It is played by 
two people on a board of intersecting lines (19 left-to-right 
lines, 19 t op -to -bottom lines , 361 intersections in all). 
Players take turns. During his turn, a player may cover one 
intersection with a marker; (one player uses white markers; 
the other player uses black markers). The object of the game 
is to get five adjacent markers in a row, horizontally, ver- 
tically or along either diagonal. 

Unfortunately, this program does not make the computer a very 
good player. It does not know when you are about to win or 
even who has won. But some of its moves may surprise you. 

Computer Limitations 

This program is dimensioned (in Statement 120) for a 19x19 
board. Depending upon the size of your computer, you may have 
to scale this down. A 7x7 board is the smallest that can be 
used for a meaningful game. 

Source 



Peter Sessions 

People' 1 s Computer Company 

Menlo Park, CA 94025 




111 



PROGRAM LISTING 



10 PRINT\PRI 
20 PR1N7APRI 
30 PRINT "TH 

40 PRINT "IN 
50 PRINT' "5 
60 PRINT »»AL 
70 PRINT 

50 PRINT\PPI 
90 PRINT "TO 
110 PRINT 

115 IF N>* 

116 KOTO 120 

117 If- N<2P 
120 PHI NT "I 
21? FOR 1*1 
300 PRINT\PR 
310 PRINT »Y 
320 IF I = -l 
330 X«I\YsJ\ 
34« PRINT "1 

41 PI IF A (I.J 
420 PRINT "S 
440 'A(T, J')«l 
5tf0 REM 

5 1 Pi FOR E«-l 
540 LET X»I + 
570 IF L*tf T 
580 IF ACXtY 
590 NEXT F\N 
600 REM •** 
61^ LET Xml 
650 IF AfX. 
66« ACX,V)«2 
710 X«I-EW« 
7b* IF L«'/ 
760 f^OTQ 65 
8ir5(^ REN *** 

810 For 1=1 

840 NEXT J\P 
90?. REM *** 
910 L«1\IF X 
920 IF X>N T 
930 IF Y<1 T 
940 IF Y>n T 
9Si* RETURN 
970 LET l« l *\ 
980 PPINTVPP 
Q B *S PRINT "P 
990 IF Qsi T 
999 END 



NT "WELCOME TO t 
NT "THE GAME IS 
AT YOU SPECIFY. 
TE«SECT10M *ITH 

AD J AC E" NT *a"rK"ERT 

ONG EITHER PlAGC 
RKED WITH A <i», 

T "THE COMPUTE? 

£^D THE GAME, 
HAT IS YOU" BOA»* 
HEN 117 



HE ORIENTAL GAME OF GOMOKO" 

PLAYED ON AN N BY N GRlo OF A SIZE" 

DURING YOUR PLAY, YOU MAY COVER ONE GRID" 
A MARKER. THE OBJECT OF THE GAME IS TO GET" 
""In A'" ROW*- HORIZONTALLY, VERTICALLY, OR" 
NAL. ON THE BOARD DIAGRAM, YOUR MOVES ARE" 
AND THE COMPUTER MOVES WITH A '2'." 
DOES NOT KEEP TRACK OF WHO HAS WON," 
YPE i-i r -ii FOR YOUR MOVE"\PRlNT- 
D SIZE (MINI a/, MAX s 19)"?\INPIJT N 



HEN 3*i" 

SAID, THE MINI: 

TO N\FOP J«i TO 

INT "fcE ALTERNA 

OUR PLAY CT7J)" 

en 9 By 

GCSUB <MO\IF L«i 

LLEGAL MOvF. T«t 

)s0 THEN 4 40 

OUARE OCCUPIED, TRY AGAIN,, ,"\GOTO 310 



UM SIZE IS 7, AMD Th£ MAXIMUM IS 19."\G0T0 11? 

N\A(X,Y)«»0\NEXT T\NEXT I 

E MOVES, YOU GQ FIRST,,, "VPRIMT 

UmPUT I.J 

then 4j? 
AGAIN,,,»\GOTO 310 



COMPUTER TRIES 
T.fi l\FOR F»-l 
E\LfcT Y*J+F\GOSU 
EN 590 
si Then 7 It: 
EXT E 

COMPUTER TRIES A 
T(:-J*Rwf)(0n + l\Lf 
)<>*-• THEN 6 It? 
SG08UB SjcAGOTO 
J.F\GOSUH 910 
HE^ 610 

PRIkT ThE BqArO 

Tq fAFn» Jal TO 

IM AivfcXT I\PR.t 

C^ElK WhETHFR Mb 

<1 ThEw 97i; 
HE?- : 97m 
H£N 970 
HE*' Q 70 

RETL'Rw 

IK.T "THANKS FOR 
LAY AGA.I*> ! U FOR 
Hfh 110 



N 'INTELLIGENT' MOVF. *** 
n l\TF E+F-E*F«0 THEN 590 
B 91Pi 



RANOO'M MOVE * + * 
■ YsINT(RNDC0))+l\GOSU» 910AIF L»* THEN 610 



(APR I NT A(I,J); 

*T \RETURm 

v'fc IS LEGAL *** 



ME GAMfcj J" 

YES, » FOR NO)"?\INPUT 



SAMPLE RUN 

WELCOME TO THE ORIENTAL GAME OF GOMOKO 

THE GAME IS PLAYED ON AN N BY N GRID OF A SIZE 
THAT VOL! SPEC IF V: DURING VOUR PLAV, VOU MflV COVER ONE GRID 
INTERSECTION WITH A MARKER. THE OBJECT OF THE GAME IS TO GET 
5 ADJACENT MARKERS IN A ROW — HORIZONTALLY, VERTICALLY, OR 
ALONG EITHER DIAGONAL. ON THE BOARD DIAGRAM, YOUR MOVES ARE 
'MARKED WITH A 'l', AND THE COMPUTER MOVES WITH A '2'. 

THE COMPUTER DOES NOT KEEP TRACK OF WHO HAS WON. 
TO END THE GAME, TYPE '-1,-1' FOR VOUR MOVE 

WHAT IS YOUR BOARD SIZE (MIN =7, MAX = 19)? 8 

HE ALTERNATE MOVES. VOU GO FIRST. . . 

VOUR PLAV U, J)? 4, 4 



y 



O 




VOUR PLAV (I, J>? 5,5 






0. 











2 








2 O 









































VOUR PLAV 


a 


J> 


? 3 


3 




ij 




















2 























1 























1 























1 























2 








2 










































VOUR PLAV a, J)? 



2 

10 1 
1 
1 







VOUR PLAV U, J)? 5, 3 






2 




VOUR PLAV (I, J)? 4,5 


















2 








1 











1 











1 














2 





















VOUR PLAV U, J)? 4, 2 






1 





1 














1 


i 


1 











2 


1 





1 











2 











2 








2 











O 














9. 














VOUR PLAV 


a 


■ J ) 


? 4 


. 2 




2 O 




















2 











2 











1 





1 











1 


1 


i 


1 











2 


1 





1 











2 











2 








2 O 





















2 







VOUR PLAV (1, J)? 4, 5 
SQUARE OCCUPIED. TRY AGAIN. 
VOUR PLAV (I, J)? 4, 6 . 

2 



2 

1 

1 1 
1 

2 









2 







VOUR PLAV <I, J)? -1,-1 



THANKS FOR THE GAME! ! 

PLAV AGAIN <1 FOR YES, FOR NO)? 



112 



PROGRAM LISTING 



SAMPLE RUN 



"THIS IS fl NUMBER GUESSING GAME. I'LL THINK" 

"OF A NUMBER BETWEEN 1 AND ANY LIMIT YOU WFlNT. 

"THEN YOU HAVE TO GUESS WHAT IT IS. " 

"WHAT LIMIT DO YOU WANT".; 



1 PRI 

2 PRI 

3 PRI 

4 PRI 

5 PRI 

6 INPL 

7 PRI 

3 L1=INT<L0G<L>/L0G(2>>+1 

10 PRIM'M THINKING OF A NUMBER BETWEEN 1 AND"L 

11 G = l 

14 PRI "NOW YOU TRY TO GUESS WHAT IT IS" 

15 M=INT<L*RND<0))+1 
28 INP N 

21 IF N>0 THEN 25 

22 G0SUB7O 

23 GOTOl 

25 IF N=M THEN 50 

30 G±G + 1 

31 IF N>M THEN 40 

32 PRI "TOO LOW. GUESS AGAIN. " 

33 GOTO 20 

40 PRI "TOO HIGH. GUESS AGAIN. " 

42 GOTO 20 

50 PRI "THAT'S IT! YOU GOT IT IN "6 "TRIES. 

52 IF G<L1 THEN 58 

54 IF G=L1 THEN 60 

56 PRI "YOU SHOULD HAVE BEEN ABLE TO GET IT IN ONLVLi" 

57 GOT 65 

58 PR I "VERY ".; 
69 PRI" GOOD 1 

65 G0SUB70 

66 GOTOIO 

76 FOR H=l TO 5 

71 PRI 

72 NEXT H 

73 RETURN 
99 END 



THIS IS A NUMBER GUESSING GAME. I'LL THINK 
OF A NUMBER BETWEEN 1 AND ANY LIMIT YOU WANT. 
THEN YOU HAVE TO GUESS WHAT IT IS. 

WHAT LIMIT DO YOU WANT? 100 

I'M THINKING OF A NUMBER BETWEEN 1 AND 100 

NOW YOU TRY TO GUESS WHAT IT IS 

? 50 

TOO HIGH. GUESS AGAIN. 

? 25 

THAT'S IT! YOU GOT IT IN 2 TRIES. 

VERY GOOD! 



I'M THINKING OF A NUMBER BETWEEN 1 AND 100 

NOW YOU TRY TO GUESS WHAT IT IS 

•? 50 

TOO HIGH. GUESS AGAIN. 

? 25 

TOO LOW. GUESS AGAIN. 

? 37 

TOO HIGH. GUESS AGAIN. 

? 31 

TOO HIGH. GUESS AGAIN. 

7 28 

TOO LOW. GUESS AGAIN. 

'? 29 

TOO LOW. GUESS AGAIN. 

? 30 

THAT'S IT! YOU GOT IT IN 7 TRIES. 

GOOD ! 



I'M THINKING OF A NUMBER BETWEEN 1 AND 100 

HOW YOU TRY TO GUESS WHAT IT IS 

? 50 

TOO LOW. GUESS AGAIN. 

? 75 

TOO HIGH. GUESS AGAIN. 

? 62 

TOO LOW. GUESS AGAIN. 

? 67 

TOO LOW. GUESS AGAIN. " 

? 71 

TOO LOW. GUESS AGAIN. 

? 73 '■'■'-*■ 

THAT'S IT! YOU GOT IT IN 6 TRIES. 

VERY GOOD! 



114 



GUESS 



GUESS A RANDOM NUMBER 

Description 

In Program GUESS, the computer chooses a random integer between 
and any limit you set. You must then try to guess the number 
the computer has chosen using the clues provided by the computer. 

You should be able to guess the number in one less than the 
number of digits needed to represent the number in binary 
notation — i.e., in base 2. This ought to give you a clue as 
to the optimum search technique. 

Computer Limitations 

There are no real limitations; however, the listing is from 
DIGITAL EduSystem 20 BASIC which accepts statements abbreviated 
to the first three letters. 

Program Author 

GUESS converted from the original program in FOCAL which appeared 
in the book "Computers in the Classroom" by: 

Walt Koetke 
Lexington High School 
Lexington, MA 02173 



3 



" 83 



39 



56 



Sj 



40 

62 



45 



78 



113 



GUNNER 



FIRE A FIELD ARTILLERY WEAPON 



Description 



These two programs allow you to adjust the fire of a field 
artillery weapon to hit a stationary or moving target/ You 
specify the number of degrees of elevation of your weapon; 
45 degrees provides maximum range with values under or over 
45 degrees providing less range. 

GUNNER is the simpler of the two programs and gives you up to 
five shots to destroy the enemy before he destroys you. Gun 
range is fixed at 46,500 yards, burst radius at 100 yards; you 
must specify elevation within approximately 0.2 degrees to get 
a hit. 

GUNERl is more complex and allows you to specify the speed at 
which your target is moving (but not directionl), and your 
burst radius. Also, your gun has a different maximum range 
randomly determined each play. 



Source 

GUNNER: 

Tom Kloos 

Oregon Museum of Science 

and Industry 
Portland, Oregon 97200 



GUNERl: 

Original author unknown. 

Converted by students at; 
Lexington High School 
Lexington, MA 02173 




115 



GUNNER PROGRAM LISTING 



SAMPLE RUN 



10 REM *** MODIFIED AND CONVERTED TO RSTS/E BV DAVID AHL, DIGITAL 

90 RANDOMIZE 

10© PRINT "THIS COMPUTER DEMONSTRATION SIMULATES THE" 

110 PRINVRESULTS OF FIRING A FIELD ARTILLERY' WEAPON. " 

120 PRINT 

130 PR I NT "VOU ARE THE OFFICER-IN-CHARGE, GIVING ORDERS TO THE GUN" 

140 PR I NT "CREW, TELLING THEM THE DEGREES OF ELEVATION VOU ESTIMATE" 

150 PRINT"WILL PLACE THE PROJECTILE ON TARGET. A HIT WITHIN LQQ VARDS" 

160 PRINT "OF THE TARGET WILL DESTROV IT. TAKE MORE THAN 5 SHOTS," 

170 PRINT "AND THE ENEMV WILL DESTROV VOU! "SPRINT 

180 PR I NT "MAX I MUM RANGE OF VOUR GUN IS 46509 VARDS. " 

1:35 2=0 

190 PRINT 

1.95 S1=0 

200 LET T=43000^30000*RND<:X> 

210 LET S=0 

220 GO TO 270 

230 PRINT-MINIMUM ELEVATION OF GUN IS ONE DEGREE. " 

240 GO TO 290 

250 PR I NT "MAX I MUM ELEVATION OF GUN IS 89 DEGREES. " 

260 GO TO 399 

270 PR I NT "OVER TARGET BV"; ABS<E>; "VARDS. " 

280 GO TO 290 

290 PRINT "SHORT OF TARGET BV"; ABS<E>; "VARDS. " 

200 GO TO 290 

210 GO TO 220 

220 PRINT"***TARGET DESTROVED*** "; S; "ROUNDS OF AMMUNITION EXPENDED" 

222 GOSUB 600 

225 S1=S1+S 

220 IF 2=4 THEN 49© 

240 2=2+1 

245 PRINT 

250 PRINT"THE FORWARD OBSERVER HAS SIGHTED MORE ENEMV ACTIVITV. " 

260 GO TO 200 

270 PRINT" DISTANCE TO THE TARGET IS"; INT<:T>; "VARDS " 

280 PRINT 

290 PRINT 

400 PR I NT "ELEVATION: "; 

410 INPUT B 

420 IF BI>89 THEN 250 

430 IF B<1 THEN 226 

440 LET S=S+1 

442 IF S<6 THEN 450 

444 PRINTSPRINT "BOOM ! ! ! VOU HAVE JUST BEEN DESTROVED "; 

445 GOSUB 600 

446 PRINT "BV THE ENEMV"\PRINTSPRINT\G0T0 495 

450 LET B2=2*B/57. 2SLET I=46500*SIN<.B2>\LET X=T-I\LET E=INTOO 
460 IF ABS<E)<100 THEN 210 
470 IF E>100 THEN 290 
480 IF E<-100 THEN 270 

490 PRINT\PRINT\PRINT "TOTAL ROUNDS EXPENDED WERE"; SI 
. 491 IF Sl>15 THEN 495SPRINT "NICE SHOOTING ! ! "SGOSUB 60OSGOTO 500 
495 PRINT "BETTER GO BACK TO FORT SILL FOR REFRESHER TRAINING! " 
500 PRINTSPRINT "THANK VOU FOR PLAVING!" 

505 PRINTSPRINT "TRV AGAIN "\PRINT\GOTO 180 

600 FOR N=l TO 10SPRINT CHR*<!7>; \NEXT N 
610 RETURN 
999 END 

READV 



THIS COMPUTER DEMONSTRATION SIMULATES THE 
RESULTS OF FIRING A FIELD ARTILLERY' WEAPON. 

VOU ARE THE OFFICER-IN-CHARGE, GIVING ORDERS TO THE GUN 
CREW, TELLING THEM THE DEGREES OF ELEVATION VOU ESTIMATE 
WILL PLACE THE PROJECTILE ON TARGET. A HIT WITHIN 160 VARDS 
OF THE TARGET WILL DESTROV IT. TAKE MORE THAN 5 SHOTS, 
AND THE ENEMV WILL DESTROV VOU! 

MAXIMUM RANGE OF VOUR GUN IS 4650O VARDS. 

DISTANCE TO THE TARGET IS 41757 VARDS 



ELEVATION:? 35 

OVER TARGET BV 1937 VARDS. 



ELEVATION:? 33 

OVER TARGET BV 721 VARDS. 



ELEVATION:? 31. 8 

SHORT OF TARGET BV 108 VARDS. 



ELEVATION:? 31. 9 
***TARGET DESTROVED*** 



4 ROUNDS OF AMMUNITION EXPENDED 



THE FORWARD OBSERVER HAS SIGHTED MORE ENEMV ACTIVITV. 
DISTANCE TO THE TARGET IS 21460 VARDS 



ELEVATION:? 16 

OVER TARGET BV 318© VARDS. 



ELEVATION:? 12 

SHORT OF TARGET BV 1077 VARDS. 



ELEVATION:? 14. 3 

OVER TARGET BV 798 VARDS. 



ELEVATION:? 13. 8 
***TARGET DESTROVED*** 



4 ROUNDS OF AMMUNITION EXPENDED 



THE FORWARD OBSERVER HAS SIGHTED MORE ENEMV ACTIVITV. 
DISTANCE TO THE TARGET IS 14943 VARDS 



ELEVATION:? 9 

SHORT OF TARGET BV 575 VARDS. 



ELEVATION:? 9. 5 

OVER TARGET BV 195 VARDS. 



ELEVATION:? 9. 2 

SHORT OF TARGET BV 112 VARDS. 



ELEVATION:? 9. 27 
***TAR6ET DESTROVED*** 



4 ROUNDS OF AMMUNITION EXPENDED 



THE FORWARD OBSERVER HAS SIGHTED MORE ENEMV ACTIVITV. 
DISTANCE TO THE TARGET IS 28518 VARDS 



ELEVATION:? 28 
***TARGET DESTROVED*** 



1 ROUNDS OF AMMUNITION EXPENDED 



THE FORWARD OBSERVER HAS SIGHTED MORE ENEMV ACTIVITV. 
DISTANCE TO THE TARGET IS 28617 VARDS 



ELEVATION:? 21 

OVER TARGET BV 2495 VARDS. 



ELEVATION:? 19 
***TARGET DESTROVED*** 



2 ROUNDS OF AMMUNITION EXPENDED 



TOTAL ROUNDS EXPENDED WERE 15 

BETTER GO BACK TO FORT SILL FOR REFRESHER TRAINING! 



THANK VOU FOR PLAVING! 
TRV AGAIN 



116 



GUNERl PROGRAM LISTING 



SAMPLE RUN 



TYPE CTRL/C TO TERMINATE THE PROGRAM. TO THE flUESTON" 
"•ENTER SPFHV TYPF A NUMBER BETWEEN 1 AND 100, THIS IS THE" 
"RELATIVE SPEED OF THE TARGET WHERE 1 IS THE SLOWEST AND 100" 

"IS THF FASTEST." 



100 RPM ARTILLFRY FIRING GAME 

110 DIM A«(7) 

120 RANDOMIZE 

170 PRINT "DO YOU WANT INSTRUCTIONS"; 

140 INPUT At 

150 PRINT 

1S0 IF A*r"NO" THEN 370 

170 PRINT " THIS GAME TESTS YOUR ABILITY TO HIT A MOVING TARGET," 

180 PRINT "YOU MUST nrcjTROY IT BEFORE IT DESTROYS YOU OR MOVES OUT" 

190 PRINT "OF RANGE. THE TARGET WILL MOVE RAMDOMLY." 

200 PRINT 

210 PRINT 

220 PRINT 

270 PRINT 

240 PRINT 

250 PRINR 

260 PRINT "TO THF OUFSTION 'ENTER DISTANCF' ENTER THE MAXIMUM DISTANCE" 

270 PRINT "YOU CAN HIT Fj?OM THE TARGET AND STILL DESTROY IT. THIS IS" 

280 PRINT "THE KILL RADIUS AND 500)0 IS SUGGESTED FOR STARTERS." 

290 PRINT 

300 PRINT "ELEVATION IS THE FLFVATION OF YOUR GUN IN DEGREES WHEN YOU" 

710 PRINT "FIRE AT THF TARGFT. THE MAXIMUN RANGE IS AT 45 DEGREES" 

320 PRINT 

770 PPINT "FNTER SPFFD"; 

740 INPUT S 

750 TF S<1 THEN 770 

760 IF S>!00 THEN 770 

770 PRINT "FNTFP DISTANCF"? 

780 INPUT D 

7Q0 IV D<0 THEN 770 

400 IF D>!0000 THEN 770 

412 M= 100000- 75000*RND(0) 

420 PRINT 

470 PRINT "THF MAXIMUM RANGF OF YOUR GUN IS "M" YARDS" 

440 FOR Krl TO M/10000 

450 LFT K1=RND(0) 

460 NEXT K 

470 Rr.95*M-.6*M*RNDC0) 

480 LFT N = 

490 GOTO 520 

500 I* R>M THEN 840 

5 10 IF R<rCM/2.5) THFN 860 

520 PRINT "TARGFT RANGF IS"R" YARDS" 

5 30 PRINT "ELEVATION": 

5 40 INPUT E 

550 IP E<0 THFN 840 

560 IP F> S9 THEN 800 

570 IFF <! THFN 820 

=;80 N = N+1 

590 K=INT(R-M*SIN(2*F/S7.^)) 

600 KUABSCK) 

610 IF K1<D THEN 6*0 

620 IF K>D THEN 720 

670 IF K<-D THFN 740 

640 STOP 

65 PRINT "*** TARGFT DESTROYED ***" 

eSP) 00SU3 940 

670 DlrK 

680 FOR K=! TO N+D/100 

690 KlrRND(0) 

700 NFXT V 

710 GOTO 410 

720 PRINT "SHORT OF TARGET BY "Kl" YARDS" 

730 GOTO 74* 

740 PRINT "OVER TARGFT ^Y "?K1"YARDS" 

74* LFT C = INTC2*RNDC0)-M) 

746 IF c=l THFN 750 

748 LFT Cz-1 

749 GOTO 760 

750 LET Crl 

760 C1=M*S/100*RNDC0) 

770 Cl=C*Cl 

780 R=R+C1 

790 GOTO 500 

800 PRINT "MAXIMUM EVEVATION IS 89 DEGREES" 

F10 GOTO 530 

K20 PRINT "MINIMUM FLFVATION IS 1 DEGREE" 

830 GOTO 5 30 

*40 PRINT "* TARGFT OUT PF RANGF *" 

850 GOTO 670 

860 PRINT "THF TARGET HAS DESTROYED YOU!" 

870 GOTO 670 

940 IP Nrl THEN 970 

950 PRINT N" ROUNDS EXPENDED" 

960 RETURN 

070 PRINT "***** DIRECT HIT *****" 

980 RETURN 

990 END 



DO vOU WANT INSTRUCTIONS'? YFS 

THIS GAME TESTS YOUR ABILITY TO HIT A MOVING TARGET. 
YOU MUST DESTROY IT REFORF IT DESTROYS YOU OR MOVES OUT 
OE RANGF. THF TARGFT WILL MOVE RAMDOMLY. 

TYPF CTRL/C TO TERMINATE THF PROGRAM . TO THE 0UESTON 
'ENTER SPEED' TYPE A NUMBER BETWFEN 1 AND 100, THIS IS THE 
PELATIVF SPEED OF THE TARGET WHERE 1 IS THE SLOWEST AND 100 
IS THF FASTEST. 

TO THF QUESTION 'ENTER DISTANCE* ENTER THE MAXIMUM DISTANCE 
vOU CAN HIT FROM THF TARGFT AND STILL DESTROY IT. THIS IS 
THE KILL RADIUS AND 5000 IS SUGGFSTED FOR STARTERS, 

ELEVATION IS THE ELFVATION OE YOUR GUN IN DEGREES WHEN YOU 
EIRE AT THE TAPGFT. THF MAXIMUN RANGE IS AT 45 DEGREES 

ENTER SPEED? 100 
ENTFR DISTANCF? 5000 

THF MAXIMUM RANGE F YOUR GUN IS 267*7.49 YARDS 

TARGET RANGE IS 19571.22 YARDS 

FLFVATION? 60 

*** TARGFT DESTROYED *** 

***** DIRECT HIT ***** 

THF MAXIMUM RANGE OE YOUR RUN IS 

TARGET RANG* IS 19498.91 VARDS 

ELEVATION? 70 

*** TARGET DESTROYED *** 

***** DIRFCT HIT ***** 

THE MAXIMUM RANGF OE YOUR GUN IS 
TARGET RANGF IS 26990.9 YARDS 
ELEVATION? 70 

SHORT OE TARGET BY 7198 vaRDS 
TARGFT RANGE IS 24494. 7^ YARDS 
FLFVATION? 68 
*** TARGET DESTROYED *** 
2 ROUNDS EXPENDED 

THE MAXIMUM RANGE QE YOUR GUN IS 27489.9 YARDS 

TARGFT RANGF IS 24327.48 YARDS 

FLFVATION? 3P«-0 

*** TARGET DESTROYED *** 

***** DIRECT HIT ***** 



37888.44 YARDS 



70785.11 YARDS 



THE MAXIMUM RANGF OF YOUR GUN IS 

TARGET RANG* IS 12849.87 YARDS 

ELEVATION? 70 

OVER TARGET BY 994 1 YARDS 

THE TARGET HAS DESTROYED YOU! 

THE MAXIMUM RANGE OF YOUR GUN IS 
TARGET RANGE IS 48*85.2 YARDS 
FLFVATION? 
tC 



26716.88 YARDS 



60008.68 YARDS 



117 



HANG 



GAME OF HANGMAN 



Description 



This is a simulation of the word guessing game, hangman. The 
computer picks a word, tells you how many letters in the word 
it has picked and then you guess a letter in the word. If you 
are right, the computer tells you where that letter belongs; 
if your letter is wrong, the computer starts to hang you. You 
get ten guesses before you are completely hanged: 

Head 

Body 

Right and Left Arms 

Right and Left Legs 

Right and Left Hands 

Right and Left Feet 

In this program, the PRINT statement is abbreviated to "Sc." 
You may add words in Data statements following Statement 508 7 
in this case, you must also change the random word selector in 
Statement 40. 

Source 

Interesting versions of Hangman were received from Brandy 
Brylawski, a seventh grader at the Eaglebrook School, Deerfield, 
Mass., and a sophisticated one from W.K. Bateman at Montpelier 
Public Schools, Montpelier, Vt. 

The one printed is from a high school sophomore: 

Kenneth Aupperle 
24 Arrowhead Lane 
Melville, NY 11746 




118 



PROGRAM LISTING 



19 REM *** GAME OF HANGMAN BV DfiVE AHL, DIGITAL 

15 REM *** BASED ON A PROGRAM WRITTEN BV KEN AUPPERLE, CLASS OF ' 

28 REM *** HALF HOLLOW HILLS H. S. , DIX HILLS, NV 

25 &"GAME OF HANGMAN" : & : & 

30 DIM P*<±2, 12>,L*<20>,D*<20;>,N*<26>,IK50> 

40 C=l: RANDOMIZE :N=50 

50 D*< I :> = "-" FOR 1=1 TO 20:M=O 

60 N$<I>="" FOR 1=1 TO 26 

70 FOR 1=1 TO 12 .FOR J=l TO 12 : P$<. I, J> = " ".NEXT J : NEXT I 

80 P*<I,1> = "X" FOR 1=1 TO 12 

90 P$<1, I>="X" FOR 1=1 TO 7:P*<2, 7>="X" 

95 IF C<N THEN 1©@ ELSE PRINT "VOU DID ALL THE WORDS !!": STOP 

100 G=INT<N+RND+1> 

110 IF I_KQ>=1 THEN 10© ELSE IKQ>=1 : C=C+1 : RESTORE : T1=0 

150 READ A* FOR 1=1 TO Q 

160 L=LEN<:A*>:L*a>=MID<.A*, I,l> FOR 1=1 TO L 

170 A"HERE ARE THE LETTERS VOU USED." 

ISO FOR 1=1 TO 26:*: N*<I>; : IF N*< I+l> = " " THEN 288 

190 PRINT ", "; .NEXT I 

200 4:*:F0R 1=1 TO L:A D*< -I >i : NEXT I : ii : i< 

210 INPUT "WHAT IS VOUR GUESS"; .Q* : R=0 

220 FOR 1=1 TO 26: IF N*a> = "" THEN 259 

230 IF G*=N*<I> THEN * "VOU GUESSED THAT LETTER BEFORE" : GOTO 170 

240 NEXT 1:& "PROGRAM ERROR. RUN AGAIN. ".STOP 

250 N*<I>=G*:T1=T1+1 

260 FOR 1=1 TO L.IF L*<I>=G* THEN 280 

270 NEXT I: IF R=0 THEN 298 ELSE GOTO 30S 

280 D*a>=G*:R=R+l:GOTO 278 

290 M=M+1 : GOTO 400 

200 FOR 1 = 1 TO L:IF D*a> = "-" THEN 220 

310 NEXT I : GOTO 290 

220 A .FOR 1=1 TO L.A D$a>;:NEXT !:&:& 

228 INPUT "WHAT IS VOUR GUESS FOR THE WORD"; B* 

240 IF B*=ft* THEN 360 

350 A "WRONG. TRV ANOTHER LETTER. " : & : GOTO 170 

360 A"RIGHTM IT TOOK VOU"Tl"GUESSES ! " 

378 INPUT "WANT ANOTHER WORD"; Wf: IF W*="VES" THEN 50 

380 A: A" IT'S BEEN FUN! BVE FOR NOW. " : STOP 

390 A "VOU FOUND THE WORD !" :GOTO 378 

400 A: A. A "SORRV, THAT LETTER ISN'T IN THE WORD. " 

410 ON M GOTO 415, 428, 425, 428, 425, 448, 445, 458, 455, 468 

415 A"FIRST, WE DRAW A HEAD": GOTO 478 

428 A "NOW WE DRAW A BODV":GOTO 470 

425 A "NEXT WE DRAW AN ARM": GOTO 470 

428 A "THIS TIME IT'S THE OTHER ARM": GOTO 470 

425 A"NOW, LET'S DRAW THE RIGHT LEG": GOTO 478 

448 A"THIS TIME WE DRAW THE LEFT LEG": GOTO 478 

445 A "NOW WE PUT UP A HAND ".GOTO 478 

458 A "NEXT THE OTHER HAND": GOTO 470 

455 A "NOW WE DRAW ONE FOOT" : GOTO 478 

468 & "HERE'S THE OTHER FOOT — VOU' RE HUNG!!" 

470 ON M GOTO 480, 49©, 508, 518, 528, 528, 548, 558, 568, 578 

48© P*<2, 6>="-":P*<2, 7> = "-" : P*C2, 8>="-" : P*C4, 5> = " C " : P*C4, 6> = ". " 

481 P*<4, 8> = ". " :P*<4, 9> = "> " : P*K5, 6 ;« = "-" :P$C5, 7> = "-" : P*c!5, 8> = "- n ':Q 

490 P*<I, 7>="X" FOR 1=6 TO 9 : GOTO 588 

500 P$<I, I-1>="S" FOR 1=4 TO 7 .GOTO 588 



SAMPLE RUN 

HERE ARE THE LETTERS VOU USED: 



?$(.&, 9> = " 
GOTO 588 
GOTO 588 



:GOTO 588 



:A P*a, J> 



".GOTO 588 



518 P*<4, 11>="/" :P* C5, 1©;' = "/" 

528 P*<10, 6> = "/" :P$C11, 5> = "/" 

528 P* < 10, 8 > = " S " : P* < 11, 9 > = " S " 

540 P* < 2, 11 > = " \ " : GOTO 580 

550 P*<2, 2> = 'V" :GOTO 588 

568 P*<12, 1©> = "S" :P$<:i2, 11> = " 

578 P* < 12, 2 > = " - " : P* < 12, 4 > = " / " 

588 FOR 1=1 TO 12: FOR J=l TO 

59Q A: NEXT I: A: A: IF M=10 THEN 600 ELSE 170 

600 A "SORRV, VOU LOSE. THE WORD WAS "ft* 

610 A "YOU MISSED THAT ONE. DO VOU" .GOTO 270 

708 DATA "GUM", "SIN", "FOR", "CRV", "LUG", "BVE", "FLV" 

710 DATA "UGLV", "EACH", "FROM", "WORK", "TALK", "WITH", "SELF" 

720 DATA "PIZZA", "THING", "FEIGN", "FIEND", "ELBOW", "FAULT", "DIRTV" 

720 DATA "BUDGET", "SPIRIT", "QUAINT", "MAIDEN", "ESCORT", "PICKAX" 

740 DATA "EXAMPLE", "TENSION", "QUININE", "KIDNEY", "REPLICA", "SLEEPER" 

758 DATA "TRIANGLE", "KANGAROO", "MAHOGflNV", "SERGEANT", "SEQUENCE" 

768 DATA "MOUSTACHE", "DANGEROUS", "SCIENTIST", "DIFFERENT", "QUIESCENT" 

77© DATA "MAGISTRATE", "ERRONEOUSLV", "LOUDSPEAKER", "PHVTOTOXIC" 

780 DATA "MATRIMONIAL", "PARASVMPATHOMIMETIC", "THIGMOTROPISM" 

999 END 

READV 



WHAT IS VOUR GUESS? E 



SORRV, THAT LETTER ISN'T IN THE WORD. 

FIRST, WE DRAW A HEAD 

XXXXXXX 

XX 



HERE ARE THE LETTERS VOU USED: 

E 



WHAT IS VOUR GUESS? A 
-A A— 



WHAT IS VOUR GUESS FOR THE WORD? 
WRONG. TRV ANOTHER LETTER. 



HERE ARE THE LETTERS VOU USED: 
E, A 



-A A— 

WHAT IS VOUR GUESS? R 



SORRV, THAT LETTER ISN'T IN THE WORD. 

NOW WE DRAW A BODV 

XXXXXXX 



X 


— 


X 


<. 


X 


— 


X 


X 


X 


X 


X 


X 


X 


X 


X 




X 




X 





HERE ARE THE LETTERS VOU USED: 
E,A, R 

-A— -A— 

WHAT IS VOUR GUESS? 

-A-0-A-- 

WHAT IS VOUR GUESS FOR THE WORD? 
WRONG. TRV ANOTHER LETTER. 

HERE ARE THE LETTERS VOU USED: 
E, A, R, 

-A-0-A— 

WHAT IS VOUR GUESS? T 



SORRV, THAT LETTER ISN'T IN THE WORD. 

NEXT WE DRAW AN ARM 

XXXXXXX 



X 




— 


X 


s 


<. 


X 


\ 


-- 


X 




N X 


X 




\x 



119 



HELLO 



CONVERSE WITH A COMPUTER 



Description 



This is a sample of one of a great number of conversational 
programs. In a sense, it is like a CAI program except that 
its responses are just good fun. Whenever a computer is ex- 
hibited at a convention or conference with people that have 
not used a computer before , the conversational programs seem 
to get the first activity. 

In this particular program, the computer dispenses advice on 
various problems such as sex, health, money, or job. 

Source 

Digital Equipment Corp. 
Maynard, MA 01754 












^pmSSD 



120 



PROGRAM LISTING 



SAMPLE RUN 



GOT 400 

PRINT "HELLO, I'M AN EDUSVSTEM-25. MV NAME IS PETEV P. EIGHT. " 

PRISPRI "WHAT'S VOUR NAME".: SL INPUT A*SPRI 

PRI " HI THERE ■; SG0SUB588SPRI V ARE VOU ENJOVING VOURSELF HERE 

PR I "IN BEAUTIFUL MAVNARD, MASS".; 

INP B*SPRI 

IF B*="VES" THEN 70 

IF B*="NO" THEN 80 

PRI " ";SG0SUB588SPRI", 

PRI "PLEASE ANSWER 'VES 

GOT 40 

PRI "OH, I'M GALD TO HERE THAT 

GOT 100 

PRI "OH, SORRV TO HEAR THAT "jSGOSUB 588SPRI 

PRI "BRIGHTEN UP VOUR STAV A BIT 

PRI 

PRI 

PRI 

PRI 

PRI 



I DON'T 
' OR 'NO-' 



UNDERSTAND VOUR ANSWER OF '"B*"'. 
DO VOU LIKE IT HERE 



;\GOSUB500\PRI 



MAVBE WE CAN 



"SAV, ",SGOSUB500SPRI", I CAN SOLVE ALL KINDS OF PROBLEMS 
"EXCEPT THOSE DEALING WITH GREECE. WHAT KIND OF 
"PROBLEMS DO VOU HAVE (ANSWER SEX, HEALTH, MONEV, 
"OR JOB)"; 

INP C*SPRI 

IF C*="SEX" THEN 200 

IF C*="HEALTH" THEN ISO 

IF C*="MONEV" THEN 160 

IF C*="JOB" THEN 145 

PRI "OH, ■; \GOSUB580\PRI" 

GOT 250 

PRI "I CAN SYMPATHIZE WITH VOU 

PRI "VERV LONG HOURS FOR NO PAV -- AND SOME OF MV BOSSES REALLV 

PRT'BEAT MV KEVBOARD. MV ADVICE TO VOU "■; SG0SUB588SPR I ", IS TO SELL 



VOUR ANSWER OF 



"C*" 



IS GREEK TO ME. 



\G0SUB588\PRIV I HAVE TO WORK 



^**70 

I>*S5 

>195 

200 

■ 205 
218 

\" 2 * 3 

*"<5?20 

-•,. 225 
>23 

-235 
2-40 
^50 
255 
260 
270 
273 
275 
278 
280 
285 
308 
382 
305 
307 
310 
315 
325 
330 
335 
340 
345 
«*-*350 
355 
360 
365 
370 
375 
388 
385 



PRI "IN THE EDUCATION MARKET. IT'S GREAT FUN. 

GOT 250 

PRI "SORRV, "JSGOSUB500VPRI", I'M BROKE TOO. WHV DON'T VOU SELL 

PRI "ENCVCLOPEADIAS OR MARRV SOMEONE RICH OR STOP EATING 

PRI "SO VOU WON'T NEED SO MUCH MONEV? 

GOT 250 

PRI "MV ADVICE TO VOU ".; \GOSUB580\PRI ", IS: 

PRI " 1. TAKE TWO ASPRIN 

PRI " 2. DRINK PLENTV OF FLUIDS (ORANGE JUICE, NOT BEER!) 

PRI " 3. GO TO BED (ALONE) 

GOT 250 

PRI "IS VOUR PROBLEM TOO MUCH OR TOO LITTLE".; 

INP D*\PRI 

IF D*="TOO MU" THEN 220 

IF D*="TOG LI" THEN 238 

PRI "DON'T GET ALL SHOOK B .;\60S 588\PRI ",JUST ANSWER THE QUESTION 

PRI "WITH 'TOO MUCH' OR 'TOO LITTLE'. WHICH IS IT".; 

GOT 285 

PRI "VOU CALL THAT A PROBLEM?!! I SHOULD HAVE SUCH PROBLEMS! 

PRI "IF IT BOTHERS VOU, TAKE A COLD SHOWER ".; SG0SUB588SPRI". " 

GOT 258 

PRI "WHV ARE VOU HERE ■; \GOSUB580\PRI "? VOU SHOULD BE 

"IN TOKVO OR NEW VORK OR AMSTERDAM OR SOMEPLACE WITH SOME 

'REAL ACTION. 



"^ 



V 



400 

402 
^05 
410 
~ x 500 
%510 
339 



PRI 

PRI 

PRI 

PRI "ANV MORE PROBLEMS VOU WANT SOLVED, " 

INP ESSPRI 

IF E*="VES" THEN 280 

IF E*=»NO" THEN 300 

PRI "JUST A SIMPLE 'VES' OR 'NO' PLEASE, 

GOT 255 

PRI "WHAT KIND (SEX, MONEV, HEALTH, JOB) 8 

GOT 125 

PRI 

PRI "THAT WILL BE $5. 88 FOR THE ADVICE, " 

PRI "PLEASE LEAVE THE MONEV ON THE TERMINAL. 

PRISPRISPRI 

PRI "DID VOU LEAVE THE MONEV"; 

INP G*SPRI 

IF G*=»YES" THEN 358 

IF G$="NO" THEN 370 

PRI "VOUR ANSWER OF '"G$» 

PRI "RESPOND WITH A 'VES' 

GOT 318 

PRI "HEV, ".;\GOSUB580SPRI"??? VOU LEFT NO MONEV AT ALL! 

PRI "VOU ARE CHEATING ME OUT OF MV HARD-EARNED LIVING. 

PRI "RIP OFF, •} SGOSUB500SPRI". *=*=*=*=*=*=*=+=*=*=*=*=*=*=*=*=* 

GOT 398 

PRI "THAT'S HONEST, ".; SG0SUB588SPRI ", BUT HOW DO VOU EXPECT 

PRI "ME TO GO ON WITH MV PSVCHOLOGV STUDIES IF MV PATIENTS DON'T 

PRI "PAV THEIR BILLS? 

PRISPRISPRI "NOW LET ME TALK TO SOMEONE ELSE. 

PRI "NICE MEETING VOU B .;SGOS 588SPRI ". HAVE A NICE DAV!! 

FOR N = l TO 7 

PRI 

NEX N 

GOT 18 

T = fl*(0)SFOR 1=1 TO INT(T/'6+l)SPRINT A*(I).;SNEXT 

RETURN 

END 



' CONFUSES ME, 
OR 'NO'. 



.;SG0SUB588SPRI.; 



SGOSUB580SPRI" 



.; SG0SUB588SPRI". 



•jSGOsuBseespRi". 



PLEASE 



HELLO, I'M AN EDUSVSTEM-25. MV NAME IS PETEV P. EIGHT. 

UHAT'S VOUR NAME? ALFRED E. NEWMAN 

HI THERE ALFRED E. NEWMAN. ARE VOU ENJOVING VOURSELF HERE 
IN BEAUTIFUL MAVNARD, MASS? NAH 

ALFRED E. NEWMAN, I DON'T UNDERSTAND VOUR ANSWER OF ' NAH' . 
PLEASE ANSWER 'VES' OR 'NO'. DO VOU LIKE IT HERE 
IN BEAUTIFUL MAVNARD, MASS? NO 

OH, SORRV TO HEAR THAT ALFRED E. NEWMAN, MAVBE WE CAN 
BRIGHTEN UP VOUR STAV A BIT X 

SAV, ALFRED E. NEWMAN, I CAN SOLVE ALL KINDS OF PROBLEMS 
EXCEPT THOSE DEALING WITH GREECE. WHAT KIND OF 
PROBLEMS DO VOU HAVE (ANSWER SEX, HEALTH, MONEV, 
OR JOB)? MONEV 

SORRV, ALFRED E. NEWMAN, I'M BROKE TOO. WHV DON'T VOU SELL 
ENCVCLOPEADIAS OR MARRV SOMEONE RICH OR STOP EATING 
SO VOU WON'T NEED SO MUCH MONEV? 

ANV MORE PROBLEMS VOU WANT SOLVED, ALFRED E. NEWMAN? VES 

WHAT KIND (SEX, MONEV, HEALTH, JOB)? SEX 

IS VOUR PROBLEM TOO MUCH OR TOO LITTLE? TOO MUCH 

VOU CALL THAT A PROBLEM?!! I SHOULD HAVE SUCH PROBLEMS! 
IF IT BOTHERS VOU, TAKE A COLD SHOWER ALFRED E. NEWMAN. 

ANV MORE PROBLEMS VOU WANT SOLVED, ALFRED E. NEWMAN? NO 



THAT WILL BE *5. 88 FOR THE ADVICE, ALFRED E. NEWMAN. 
PLEASE LEAVE THE MONEV ON THE TERMINAL. 



DID VOU LEAVE THE MONEV? BAH 

VOUR ANSWER OF 'BAH' CONFUSES ME, ALFRED E. NEWMAN. PLEASE 
RESPOND WITH A 'VES' OR 'NO' 
DID VOU LEAVE THE MONEV? NO 

THAT'S HONEST, ALFRED E. NEWMAN, BUT HOW DO VOU EXPECT 

ME TO GO ON WITH MV PSVCHOLOGV STUDIES IF MV PATIENTS DON'T 

PAV THEIR BILLS? 



NOW LET ME TALK TO SOMEONE ELSE. 
NICE MEETING VOU ALFRED E. NEWMAN. 



HAVE A NICE DAV! 



I 



READV 



121 



HEX 



GAME OF HEXAPAWN 



Description 

The game of Hexapawn and a method to learn a strategy for play- 
ing the game was described in "Mathematical Games" in the March 
1962 issue of Scientific American , The method described in the 
article was for a hypothetical learning machine composed of 
match boxes and colored beads. This has been generalized in 
the Program HEX. 

The program learns by elimination of bad moves. All positions 
encountered by the program and acceptable moves from them are 
stored in the array P$ (I) . When the program encounters an un- 
familiar position, the position and all legal moves from it 
are added to the list. If the program loses a game, it erases 
the move that led to defeat. If it hits a position from which 
all moves have been deleted (they all led to defeat) , it erases 
the move that got it there and resigns. Eventually, the program 
learns to play extremely well and, indeed, is unbeatable. The 
learning strategy could be adopted to other simple games with a 
finite number of moves (tic-tac-toe, small board checkers, or 
other chess-based games) . 

For complete playing directions, respond YES or Y to the ques- 
tion, INSTRUCTIONS? 

Computer Limitations 

HEX was written in BASIC -PLUS for DIGITAL RSTS-11 and RSTS/E 
systems. HEX uses string functions and concatenation extensively, 
Also, the symbol " 1 " equals REM and "&" equals PRINT. 

Program Author 

Jeff Dalton 

Northfield-Mt. Hermon School 

Northfield, MA 




122 



PROGRAM LISTING 



1 ! BY JEFF DAL TON* CLASS OF '74* NORTHFI ELD MOUNT HERMON SCHOOL 

2 ! THIS PROGRAM PLAYS THE GAME 'HEXAPAWN' BY A METHOD OUTLINED IN 

'MATHEMATICAL GAMES' IN MARCH 1962 SCIENTIFIC AMERICAN. 

3 ! THE PROGRAM LEARNS BY ELIMINATION OF BAD MOVES* ALL POSITIONS 

ENCOUNTERED BY THE PROGRAM AND THE ACCEPTABLE MOVES FROM THEM 
ARE STORED IN PSUX) 

4 I WHEN THE PROGRAM ENCOUNTERS AN UNFAMILIAR POSITION* THE POSITION 

AND ALL LEGAL MOVES FROM IT ARE ADDED TO THE LIST. 

5 ! IF THE PROGRAM LOSES A GAME* IT ERASES THE MOVE THAT LED TO DEFEAT. 

IF IT HITS A POSITION FROM WHICH ALL MOVES HAVE BEEN DELETED 

< THEY ALL LED TO DEFEAT )* IT ERASES THE MOVE THAT GOT 

IT HERE AND RESIGNS. 
18 INPUT "INSTRUCTIONS"; CS: IF LEFTCCS* 1X)<> "Y" THEN 118 
28 A: A* "THIS PROGRAM PLAYS THE GAME OF HEXAPAWN."!* 

"HEXAPAWN IS PLAYED WITH CHESS PAWNS ON A 3 BY 3 BOARD. THE PAWNS ARE": A 
"MOVED AS IN CHESS - ONE SPACE FORWARD TO AN EMPTY SPACE OR ONE SPACE" 
38 A-FORWARD AND DIAGONALLY TO CAPTURE AN OPPOSING MAN. ": A: ACHRS<9X); 
"0 THE BOARD* YOUR PAWNS ARE '0', THE COMPUTER'S PAWNS ARE '«'":A 
"AND EMPTY SQUARES ARE '-*. TO ENTER A MOVE* TYPE THE NUMBER OF THE" 
48 A-SQUARE YOU WILL MOVE FROM FOLLOWED BY THE NUMBER OF THE SQUARE": A 
"YOU WILL MOVE TO. (THE NUMBERS ARE SEPARATED BY A COMMA. )"*A 
58 A" THE PROGRAM STARTS A SERI S OF GAMES KNOWING ONLY WHEN THE"* A 
"GAME IS WON (A DRAW IS IMPOSSIBLE) AND HOW TO MOVE. IT HAS NO":A 
"STRATEGY AT FIRST AND JUST MOVES RANDOMLY. HOWEVER* IT LEARNS" 
68 A-FROM EACH GAME. THUS* DEFEATING IT BECOMES MORE AND MORE": A 
-DIFFICULT. ALSO* TO HELP OFFSET YOUR INITIAL ADVANTAGE* YOU WILL": A 
"NOT BE TOLD HOW TO WIN THE GAME BUT MUST LEARN THIS BY PLAYING":A 
188 DEF FNC$CXS*XX*YS)«LEFT<XS*XX-1X)+YS+RIGHT(X$*XX+LENCYS)) 
165 DEF FNNS<XX): XS«NUMS(XX) : FNNS-MI D<XS* 2X*LEN<XS)-2X> : FNEND 
118 DIM PS<58X): RANDOMIZE: QX»8X: 

PRINT "SINCE I'M A GOOD SPORT* YOU'LL ALWAYS GO FIRST 
128 PX-8X: P$« "♦»»-— 000": A: A"NUMBERING: ": 

A"123": A"456": A"789": A 
198 DX--1X: QS»"0": GOSUB 2888: I F MS»"" THEN 

PRINT "YOU CAN'T MOVE. I WIN.": GOTO 518 
288 A: A-BOARD:": ALEFTCPS, 3X) : AMI DCPS* 4X* 3X) : ARI GHT(PS* 7X) : A 
218 INPUT "WHAT IS YOUR MOVE"; AX*BX: 

IF INSTR(1X*MS*FNNS<AX) + FNN$<BX))»8X THEN 

PRINT "ILLEGAL MOVE.": GOTO 218 
238 PS»FNCS<FNCS<PS*AX*"-")*BX*"0">: 

IF INSTR< IX* PS* "»">» 8 X OR INSTR< IX* PS* *0"X4X THEN 

PRINT "YOU WIN.": GOTO 588 
388 PX»PX+2X ! COMPUTER'S MOVE 

318 FOR CX-1X TO QX: CS*PS<CX): IF VALCLEFTCCS* IX) )»PX AND 

MID<CS*2X*9X)»P$ THEN MS»RIGHT< CS* 1 IX) : GOTO 488 
328 NEXT CX: QS»"»": DX» 1 X: GOSUB 2888: CX»QX: 

IF MS»"" THEN PRINT "I CAN'T MOVE* YOU WIN.": GOTO 580 
488 IF MS»"" THEN PRINT "I RESIGN.": GOTO 588 
418 KS»LEFT<MS*2X): MS*RIGHT<MS* 3X> : 

IF RND>. 33333333 ANDMSo — THEN 418 
428 KX«CX: AX*VAL<LEFT<K$* 1 X)) : BX* VAL< RIGHT <KS* 2X) ) : 

PS»FNCS<FNCS<PS*AX*"-")*BX*"*") 
438 IF INSTR<1X*PS* "0")»OX OR INSTRC7X* PS* "•") THEN 

PRINT "I WIN!": GOTO 518 
448 PRINT "I MOVE FROM" AX "TO" BX: GOTO 19 8 
508 V2X-W2X+1X: I X»INSTR( 1 1 X, PSCKX)*KS) : 

PS<KX)»LEFT<PS<KX)*IX-1X)+RIGHTCPS<KX)*IX+2X) IF IX: GOTO 528 
518 W1X-W1X+1X 
528 A: A"BOARD:": ALEFTCPS* 3X) : AMI D<PS*4X* 3X) : ARI GHTCPS* 7X) : A: 

A "I HAVE WON" W1X "AND YOU HAVE WON" W2X "OF" W1X+W2X "GAMES" 
530 INPUT "ANOTHER GAME"; CS: IF CS»"NO" THEN 9999 ELSE 128 
908 ! DATA**» <- OF MOVE IN GAME><POSITION»<LI ST OF MOVES> 

IN <P0SITI0N>* -aBLANK* '-COMPUTER'S PAWN* 0*PLAYER*S PAWN 

<LIST OF M0VES> IS <- MOVE FROM><- MOVE TO><LIST OF M0VES> 
2888 MS»"" 

2818 FOR JX»1X TO 9X: I F MID<PS* JX* 1XX>QS THEN 2050 
2815 TX»JX+DX*3X: IF TX<1X OR TX>9X THEN 2825 
2828 IF MID<PS*TX* 1X)»"-" THEN 

MS»MS+FNNSCJX)+FNNS<TX) 
2825 TX»JX+DX*2X: IF TX< 1 X OR TX>9X OR 

(DX-1X AND CJX-1X OR JX»4X OR JX-7X)) OR 

<DX— IX AND <JX»3X OR JX=6X OR JX-9X)) THEN 2835 
2838 IF INSTRC lX*aS+"--*MID<PS*TX* lX)) = qx THEN 

M$»MS+FNNSCJX)+FNNS(TX) 
2835 TX»JX+DX*4X: IF TX< 1 X OR TX>9X OR JX-3X OR JX-7X THEN 2058 
2848 IF INSTRC IX* QS+"-"*MIDCP$* TX* IX) )»8X THEN 

MS«MS+FNNSCJX) + FNNSCTX) 
2858 NEXT JX: IF DX»1X AND MS<>"" THEN QX-QX+IX: PS€QX)«FNNS(PX)+PS+MS 
2868 RETURN 
9999 END 



MUM BERING I 

123 

456 

789 



BOARD: 

••• 



WHAT IS YOUR MOVE? 8*5 
I MOVE FROM 1 TO 4 

BOARD: 

.•* 
♦0- 
0-0 

WHAT IS YOUR MOVE? 5*3 
YOU WIN. 

BOARD: 
-#0 



I HAVE WON 8 AND YOU HAVE WON 1 OF 1 GAMES 
JNOTHER GAME? 



NUMBERING: 

123 

456 

789 



WHAT IS YOUR MOVE? 8*5 
I MOVE FROM 3 TO 5 

BOARD: 

•*- 
-#- 
0-0 

WHAT IS YOUR MOVE? 9*5 
I MOVE FROM 1 TO 4 
YOU CAN'T MOVE. I WIN. 



•0- 
0— 



I HAVE WON 1 AND YOU HAVE WON 3 OF 
ANOTHER GAME? 



NUMBERING: 

123 

456 

789 



BOARD: 

*** 



SAMPLE RUN 



WHAT IS YOUR MOVE? 8*5 
I MOVE FROM 1 TO 5 



BOARD: 



INSTRUCTIONS? Y 

THIS PROGRAM PLAYS THE GAME OF HEXAPAWN. 
HEXAPAWN IS PLAYED WITH CHESS PAWNS ON A 3 BY 3 BOARD. THE PAWNS ARE 
MOVED AS IN CHESS - ONE SPACE FORWARD TO AN EMPTY SPACE OR ONE SPACE 
FORWARD AND DIAGONALLY TO CAPTURE AN OPPOSING MAN. 

ON THE BOARD* YOUR PAWNS ARE '0', THE COMPUTER'S PAWNS ARE '• 
AND EMPTY SQUARES ARE '-*. TO ENTER A MOVE* TYPE THE NUMBER OF THE 
SQUARE YOU WILL MOVE FROM FOLLOWED BY THE NUMBER OF THE SQUARE 
YOU WILL MOVE TO. (THE NUMBERS ARE SEPARATED BY A COMMA.) 

THE PROGRAM STARTS A SERIES OF GAMES KNOWING ONLY WHEN THE 
GAME IS WON (A DRAW IS IMPOSSIBLE) AND HOW TO MOVE. IT HAS NO 
STRATEGY AT FIRST AND JUST MOVES RANDOMLY. HOWEVER* IT LEARNS 
FROM EACH GAME. THUS* DEFEATING IT BECOMES MORE AND MORE 
DIFFICULT. ALSO* TO HELP OFFSET YOUR INITIAL ADVANTAGE* YOU WILL 
NOT BE TOLD HOW TO WIN THE GAME BUT MUST LEARN THIS BY PLAYING 



WHAT IS YOUR MOVE? 9*5 
I MOVE FROM 3 TO 6 



-0« 
0— 



WHAT IS YOUR MOVE? 7*4 
I WIN! 



BOARD: 

-*- 

00- 



I HAVE WON 3 AND YOU HAVE WON 5 OF 8 GAMES 
ANOTHER GAME? NO 



SINCE I'M A GOOD SPORT* YOU'LL ALWAYS GO FIRST. 



123 



HI-LO 



HIGH/LOW JACKPOT GAME 



Description 



This game is an adaptation of the game GUESS; however , instead 
of just guessing a number between 1 and 100 , in this game you 
win dollars when you guess the number. The directions , in the 
words of the author of the game, are as follows: 

"1. There is an amount of money , between one and one 
hundred dollars , in the "HI-LO" jackpot. 

2. You will have six chances in which to guess the 
amount of money in the jackpot. 

3. After each guess, the computer will tell whether 
the guess was too high or too low. 

4. If the correct amount of money is not guessed after 
six chances, the computer will print the amount in 
the jackpot. 

5. If the correct amount of money is guessed within the 
six chance limit, the computer will register this 
amount. 

6. After each sequence of guesses, you have the choice 
of playing again or ending the program. If a new 
game is played, a new amount of money will constitute 
the j ackpot . 

7. If you win more than once, then your earnings are to- 
talled." 

Program Author 

Dean Altman 
3721 Wosley 
Fort Worth, TX 76133 




© 1 967 by Creative Publications 



124 



PROGRAM LISTING 

90 RANDOMIZE 

100 PKINT "THIS IS THE GAME OF HI-LO»\PRINT 

110 PRINT "YOU WILL HAVE 6 TRIES TO GUESS THE AMOUNT OF MONEY IN THE" 

120 PRINT "HI-LO JACKPOT* WHICH IS BETWEEN 1AND 100 DOLLARS. IF YOU" 

130 PRINT "GUESS THE AMOUNT, YOU WIN ALL THE MONEY IN THF JACKPOT!" 

140 PRINT "THEN YOU GET ANOTHER CHANCE TO WIN MORE MONEY. HOWEVER," 

150 PRINT "IF YOU DO NOT GUESS THE AMOUNT, THE GAME ENDS . "\PRINT 

160 R«0 

170 B»0\PRINT 

180 YeINT(100#RND) 

200 PRINT "YOUR GUESS" | 

210 INPUT A 

220 B«B+1 

230 IF A»Y THEN 300 

240 IF A>Y THEN 270 

250 PRINT "YOUR GUESS IS TOO LOW»\GOTO 280 

270 PRINT "YOUR GUESS IS TOO HIGH" 

280 PRINTAIF B<6 THEN 203 

290 PRINT "YOU BLEW IT. ...TOO BAD, ...THE NUMBER WAS" Y\R«0\GQTO 350 

300 PRINT "GOT ITllllllll YOU WIN" Y"OOLLARS, " 

310 R»R+Y 

320 PRINT "YOUR TOTAL WINNINGS ARE NOW"R"DOLLARS. " 

350 PRINTvPRINT "PLAY AGAIN (YES OR NO)"l 

360 INPUT A$\IF A$b»YES" THEN 170 

380 PRINTNPRINT "SO LnNG, HOPE YOU ENJOYED YOURSELFli" 

390 END 



SAMPLE RUN 



THIS IS THE GAME OF HI-LO 



PLAV AGAIN <VES OR NO)? VES 



YOU WILL HAVE 6 TRIES TO GUESS THE AMOUNT OF MONEY IN THE 
HI-LO JACKPOT, WHICH IS BETWEEN 1AND 100 DOLLARS. IF YOU 
GUESS THE AMOUNT, YOU WIN ALL THE MONEY IN THE JACKPOT! 
THEN YOU GET ANOTHER CHANCE TO WIN MORE MONEY. HOWEVER, 
IF YOU DO NOT GUESS THE AMOUNT, THE GAME ENDS. 



VOUR GUESS? 5S 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 75 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 87 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 94 

YOUR GUESS IS TOO HIGH 



VOUR GUESS? 58 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 75 

YOUR. GUESS IS TOO LOW 



YOUR GUESS? 87 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 94 

YOUR GUESS IS TOO HIGH 



YOUR GUESS? 91 

YOUR GUESS IS TOO HIGH 



YOUR GUESS? 89 

GOT IT! ! ! I I I ! ! YOU WIN 89 DOLLARS. 

YOUR TOTAL WINNINGS ARE NOW 174 DOLLARS. 



YOUR GUESS? 91 

YOUR GUESS IS TOO HIGH 

YOUR GUESS? 89 

YOUR GUESS IS TOO LOW 

YOU BLEW IT. . . . TOO BAD. . . . THE NUMBER WAS 90 

PLAV AGAIN <VES OR NO)? VES 

YOUR GUESS? 56 

VOUR GUESS IS TOO HIGH 

YOUR GUESS? 25 

GOT IT!!!!!!!! YOU WIN 25 DOLLARS. 

YOUR TOTAL WINNINGS ARE NOW 25 DOLLARS. 



PLAY AGAIN (YES OR NO)? VES 



YOUR GUESS? 50 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 75 

YOUR GUESS IS TOO HIGH 



YOUR GUESS? 67 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 71 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 73 

YOUR GUESS IS TOO HIGH 



PLAY AGAIN (YES OR NO)? VES 



YOUR GUESS? 50 

YOUR GUESS IS TOO HIGH 



YOUR GUESS? 25 

VOUR GUESS IS TOO LOW 



YOUR GUESS? 37 

YOUR GUESS IS TOO HIGH 



VOUR GUESS? 32 

YOUR GUESS IS TOO LOW 



VOUR GUESS? 34 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 36 

VOUR GUESS IS TOO HIGH 



VOU BLEW IT. . . . TOO BAD. . . . THE NUMBER WAS 35 
PLRY AGAIN <VES OR NO)? VES 



VOUR GUESS? 72 

GOT IT!!!!!!!! VOU WIN 72 DOLLARS. 

YOUR TOTAL WINNINGS ARE NOW 246 DOLLARS. 

PLAV AGAIN <YES OR NO)? VES 

VOUR GUESS? 50 

YOUR GUESS IS TOO HIGH 

YOUR GUESS? 25 

VOUR GUESS IS TOO LOW 



VOUR GUESS? 37 

YOUR GUESS IS TOO HIGH 



VOUR GUESS? 31 

YOUR GUESS IS TOO HIGH 



YOUR GUESS? 28 

VOUR GUESS IS TOO HIGH 



YOUR GUESS? 27 

YOUR GUESS IS TOO HIGH 



VOUR GUESS? 50 

VOUR GUESS IS TOO LOW 



VOUR GUESS? 75 

VOUR GUESS IS TOO LOW 



VOUR GUESS? 87 

YOUR GUESS IS TOO HIGH 



YOU BLEW IT. . . . TOO BAD. . . . THE NUMBER WAS 26 

PLAV AGAIN <YES OR NO)? NO 

SO LONG. HOPE YOU ENJOYED YOURSELF!! 

READY 



VOUR GUESS? 81 

VOUR GUESS IS TOO LOW 



VOUR GUESS? 84 

YOUR GUESS IS TOO LOW 



YOUR GUESS? 85 

GOT IT!!!!!!!! VOU WIN 85 DOLLARS. 

VOUR TOTAL WINNINGS ARE NOW 85 DOLLARS. 



125 



HIO 



REMOVE PEGS ON A PEGBOARD 



Description 



This is a computerized version of an old European solitaire game 
of logic called Hi-Q. The game starts with a pegboard shaped 
like a cross having pegs in every hole but the center. The 
object is to remove all 32 pegs, or as many as possible, by 
jumping into an empty hole— the jumped peg is then removed. 

There are several different winning strategies for playing 

Hi-Q arid, of course, each strategy can be played eight different 

ways on the board. Can you find a consistent winner? 

Program Author 

Charles Lund 

The American School 

Hague , Nether lands 




126 



PROGRAM LISTING 



DIM B(70),T(9,9) 

PRINT "THIS IS THE GAME OF HI-Q"SPRINT "HERE IS THE BOARD"SPRI 



5 PRINT « 




1 


1 


J" 




6 PRINT « 




13 


14 


15"\PRINT 




7 PRINT " 




I 


1 


1" 




8 PRINT " 




22 


23 


24«\PRINT 




9 PRINT "I 


1 


1 


I 


t 1 


1" 


10 PRINT "29 


30 


31 


32 


33 34 


35"SPRINT 


11 PRINT "I 


i 


I 


J 


1 I 


J" 


12 PRINT "38 


39 


40 


41 


42 43 


44"SPRINT 


13 PRINT "I 


1 


J 


J 


1 1 


J" 


14 PRINT "47 


48 


49 


50 


51 52 


53«SPRINT 


15 PRINT »< 




1 


I 


1" 




16 PRINT " 




58 


59 


60"SPRINT 




17 PRINT " 




I 


I 


1" 




18 PRINT <• 




67 


68 


69"SPRINT 





22 PRINT "TO SAVE TYPING TIME, A COMPRESSED VERSION OF THE GAME 

23 PRINT "HILL BE USED DURING PLAY. REFER TO THE ABOVE ONE FOR 

24 PRINT "NUMBERS, O.K., LET«S BEGIN..." 

28 REM *** SET UP BOARD 

29 FOR R"l TO 9 

30 FOR CM TO 9 

31 IF (R-4)*CR«5)*(R-6)«0 THEN 40 

32 IF CO4)*CC-5)*(.C-6)*0 THEN 40 

35 T(R,C)*-5 

36 GOTO 50 

40 IF (R-l)*CC»i)*fR-9)*CC«9)"0 THEN 35 
42 T(R,C)*5 
■50 NEXT C 
60 NEXT R 

65 T(5,5)«0\GOSUB 500 

70 REM *** INPUT MOVE AND CHECK ON LEGALITY 
75 FOR W*i TO 33 
77 READ M 

79 DATA 13,14,15,22,23,24,29,30,31,32,33,34,35,38,39,40,41 
81 oATA 42,43,44,47,48,49,50,51,52,53,58,59,60,67,68,69 
83 BCM)«*7\NEXT W 
86 B(41)«-3 

100 INPUT "MOVE WHICH PIECE"JZ 
110 IF B(Z)«-7 THEN 140 

120 PRINT "ILLEGAL MOVE, TRY AGAIN. ., "\GOTO 100 
140 INPUT "TO WHERE«?P 
150 IF B(P)»0 THEN 120 
153 IF B(P)s»7 THEN 120 
156 IF Z*P THEN 100 

160 IF C(2+P)/2)»INT((Z*P)/2) THEN 180 
170 GOTO 120 

180 IF CA8S(Z-P)-2)*CABS(Z-P)-18)<>0 THEN 120 
190 GOSUB 1000 
200 GOSUB 500 
210 GOSUB 1500 
220 GOTO 100 
500 REM *** PRINT BOARD 
510 FOR X«l TO 9 
520 FOR Y*l TO 9 

525 IF CX-l)*CX-9)*(Y«l)*CY-9)»0 THEN 550 
530 IF CX-4)*(X-5)*(X-6)"0 THEN 570 
540 IF (Y-4)*CY-5}*CY-6)«0 THEN 570 
550 REM 
560 GOTO 610 

570 IF TCX,Y)<>5 THEN 600 
580 PRINT TAB(Y*2)"|"? 
590 GOTO 610 
600 PRINT TAB(Y*2)"0"I 
610 REM 
615 NEXT Y 
620 PRINT 
630 NEXT X 
640 RETURN 

1000 REM*** UPDATE BOARD 
1005 C«l\POH x«l TO 9 
1020 FOR Y«l TO 9 
1030 IF CoZ THEN 1220 
1040 IF C+2<>P THEN 1080 
1045 IF T(X,Y+1)»0 THEN 120 
1050 TCX,Y*2)«5 
1060 T(X,Y*l)»0SB(C*l)«-3 
1070 GOTO 1200 
1080 IF C+l8<>P THEN 1130 
1085 IF T(X*1,Y)»0 THEN 120 
1090 T(X+?,Y)"5\T(X+1,Y)80\B(C*9)b^3 
1120 GOTO 1200 
1130 IF C-2«>P THEN 1170 
1135 IF T(X,Y-1)«0 THEN 120 
1140 T(X,Y-2)»5\T(X»Y-l)"0\B<Ci.l)«-3 
1160 GOTO 1200 
1170 IF C-1BOP THEN 1220 
1175 IF T(X-1,Y)»0 THEN 120 
1180 T(X-2.Y)»5\T(X-l,'Y)«0\B(C-9)»-3 
1200 B(Z)»-3\B(P)«-7 
1210 T(X,Y3«0\GOTO 1240 
1220 C«C*1 
1225 NEXT Y 
1230 NEXT X 
1240 RETURN 

1500 REM *** CHECK IF GAME IS OVER 
1505 F«0 

1510 FOR R»2 TO 8 
1520 FOR C«2 TO 8 
1530 IF T(P,C)<>5 THEN 1580 
1535 F«F*1 

1540 FOR A«R-1 TO R+l 
1545 T»0 
1550 FOR B»C-1 TO C-K 

1560 T«T+TfA,B) 

1561 NEXT 8 

1564 IF T<M0 THEN 1567 

1565 IF T(A,C)<>0 THEN 1630 

1567 NEXT A 

1568 FOR x»C-l TO C*l 

1569 T»0 

1570 FOR Y«R-1 TO R*l 

1571 T*T+T(Y,X) 

1572 NEXT V 

1573 IF T<>10 THEN 1575 

1574 IF T(R,X)O0 THEN 1630 

1575 NEXT X 
1580 NEXT C 
1590 NEXT P 



BOARD" 
PEG" 



1600 REM •#• GAME IS OVER 

1605 PRINT "THE GAME IS OVER," 

1610 PRINT "YOU HAD»FF»PIECES REMAINING" 

16U IF F<M THEN 1615 

1612 PRINT "BRAVOJ YOU MADE A PERFECT SCORE H". 

1613 PRINT "SAVE THIS PAPER AS A RECORD OF YOUR WORK," 
1615 PRINTMNPUT "PLAY AGAIN (YES OR NO)«|AS 

1617 IF A$»"NO" THEN 2000 

1618 RESTORESGOTO 25 
1620 STOP 

1630 RETURN 

2000 PRINTVPRINT "SO LONG FOR NOW, "SPRINT' 

2005 END 



SAMPLE RUN 



THIS IS THE GAME OF HI.-G 
HERE IS THE BOARD 



29 30 31 32 33 34 35 



49 41 42 43 44 
49 5@ 51 52 53 
58 59 60 



6? 68 69 

TO SAVE TYPING TIME, fl COMPRESSED VERSION OF THE GAME BOARD 
WILL BE USED DURING PLAY. REFER TO THE ABOVE ONE FOR PEG 
NUMBERS. O.K., LET'S BEGIN. ... 



MOVE WHICH PIECE? 
TO WHERE? 41 



MOVE WHICH PIECE? 
TO WHERE? 46 



MOVE WHICH PIECE? 49 
TO WHERE? 31 






.' 



MOVE WHICH PIECE? 47 
TO WHERE? 49 





! 
! 



MOVE WHICH PIECE? 58 
TO WHERE? 48 





! ! 

OOO 





MOVE WHICH PIECE? 41 
TO WHERE? 39 



i ! 

! 

! 



127 



HMRABI 



GOVERN ANCIENT SUMERIA 



Description 



In this game you direct the administrator of Sumeria, Hamurabi, 
how to manage the city. The city initially has 1,000 acres, 100 
people and 3,000 bushels of grain in storage. 

You may buy and sell land with your neighboring city-states for 
bushels of grain — the price will vary between 17 and 26 bushels 
per acre. You also must use grain to feed your people and as 
seed to plant the next year's crop. 

You will quickly find that a certain number of people can only 
tend a certain amount of land and that people starve if they 
are not fed enough. You also have the unexpected to contend 
with such as a plague, rats destroying stored grain, and variable 
harvests. 

You will also find that managing just the few resources in this 
game is not a trivial job over a period of say ten years. The 
crisis of population density rears its head very rapidly. 

Source 

This is translated from the original FOCAL program which has 
been floating around DIGITAL for nine or more years. 

Digital Equipment Corp. 
Maynard, MA 01754 




128 



PROGRAM LISTING 



SAMPLE RUN 



IB REM *** CONVERTED FROM THE ORIGINAL FOCAL PROGRAM AND MODIFIED FOR 

20 REM *** EDU3Y3TEM 70 BY DAVID AHL, DIGITAL 

00 PRINT "TRY YOUR HAND AT GOVERNING ANCIENT SUMERIA" 

05 PRINT "SUCCESSFULLY FOR A 10-YR TERM OF OFFICE, » IPRINT 

90 RAND0MIZE1LET Dl«0itET P1«0 

100 LET Z10ILET P«95ILET 3*2800lLET H«3000ILET E«H»S 

110 LET YfSlLET AtH/YlLET H5ILET Q»l 

210 LET D"0 

213 PRINTIPRINTIPRINT "HAMURABII I BEG TO REPORT TO YOU,"lLET Z*Z*1 

217 PRINT "IN YEAR"Z»,"D«PEOPLE STARVED, «I"CAME TO THE CITY," 

218 LET P*P*I 

227 IF G>0 THEN 230 

228 LET P«lNT(P/2) 

229 PRINT "A HORRIBLE PLAGUE STRUCKi HALF THE PEOPLE DIED." 

230 PRINT "POPULATION IS NOW»P 

232 PRINT "THE CITY NOW 0WN8«A"ACRES,« 

235 PRINT "YOU HARVESTED^VBUSHELS PER ACRE," 

250 PRINT "RATS ATE"E"BU3HELS, « 

260 PRINT "YOU NOW HAVE«Sh8USHELS IN STORE," IPRINT 

270 IF Z»ll THEN 860 

310 LET CiINT(10*RND(0))ILET Y«C*17 

312 PRINT "LAND IS TRADING AT«Y»BUSHEL3 PER ACRE," 

320 PRINT "HOW MANY ACRES DO YOU WISH TO BUY"| 

321 INPUT QlIF Q«0 THEN 850 

322 IF Y*Q<«S THEN 330 

323 GOSUB 710 

324 GOTO 320 

330 IF O»0 THEN 340 

331 LET AiA*GiLET S»S-Y*QlLET C«0 
334 GOTO 400 

340 PRINT "HOW MANY ACRES DO YOU WISH TO SELL"! 
34i INPUT QlIF G<0 THEN 880 

342 IF Q<A THEN 350 

343 GOSUB 720 

344 goto 340 

350 let a"a»qilet s«s+y*qllet c«0 

400 PRINT 

410 PRINT "HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE"! 

411 INPUT 

412 IF Q<0 THEN 850 

418 REM *** TRYING TO USE MORE GRAIN THAN IN THE SILOS? 

420 IF Q<«S THEN 430 

421 GOSUB 710 

422 GOTO 4J0 

430 LET S«S*»QlLET C"llPRlNT 

440 PRINT "HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED"! 

441 INPUT DlIF D"0 THEN 511 

442 IF D<0 THEN 850 

444 REM *** TRYING TO PLANT MORE ACRES THAN YOU OWN? 

445 IF D<«A THEN 450 

446 GOSUB 720 

447 GOTO 440 

449 REM *** ENOUGH GRAIN FOR SEED? 

450 IF INT(D/25<S THEN 455 

452 GOSUB 710 

453 GOTO 440 

434 REM *** ENOUGH PEOPLE TO TEND THE CROPS? 

455 IF D*10*P THEN 510 

460 PRINT "BUT YOU HAVE ONLY"P"PEOPLE TO TEND THE FIELDS, NOW THEN," 

470 GOTO 440 

510 LET S«3-INT(D/2) 

511 GOSUB 800 

512 REM *** A BOUNTYFULL HARVESTM 
515 LET Y«ClLET H»D*YlLET E«0 

521 GOSUB 800 

522 IF INTCC/2)<»C/2 THEN 530 

523 REM *** THE RATS ARE RUNNING WILD1J 
525 LET E*INT(S/C) 

530 LET 8aS*E*H 
331 GOSUB 800 

532 REM *** LET'S HAVE SOME BABIES 

533 LET IfINT(C*(20*A*S)/P/100*l) 

539 REM *** HOW MANY PEOPLE HAD FULL TUMMIES? 

540 LET C«XNT(Q/20) 

541 REM *** HORRORS, A 15% CHANCE OF PLAGUE 

542 LET O«INTC10*(2*RND(0)*,3)) 

550 IF P«C THEN 218 

551 REM *** STARVE ENOUGH FOR IMPEACHMENT? 

552 LET D«p*CtIF D>,45*P THEN 560 

553 LET Pi«C(Z-n*PUD*100/P)/7 
555 LET PiClLET Dl"Dt*DlGOTO 215 

560 PRINTlPRINT "YOU STARVED M D"PEOPLE IN ONE YEARUI" 

565 PRINT "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY" 

566 PRINT "BEEN IMPEACHED" AND THROWN OUT OF OFFICE BUT YOU HAVE" 

567 PRINT "ALSO BEEN DECLARED »NATIONAL FINK! ||«|GOTO 990 
710 PRINT "HAMgRABIi THINK AGAIN, YOU HAVE ONLYM 

7ti print s m bushels of grain, now then," 

712 RETURN 

720 PRINT "HAMURABII THInK AGAIN, YOU OWN ONLY" A" ACRES. NOW THEN," 

730 RETURN 

800 LET CiINT(RND(0)*5)*l 

801 RETURN 

850 PRINTlPRINT "HAMURABli I CANNOT DO WHAT YOU WISH," 

855 PRINT "GET YOURSELF ANOTHER STEWARDHIU" 

857 GOTO 990 

860 PRINT "IN YOUR 10-YEAR TERM OF OFFICE, "P1«PERCENT OF THE" 

862 PRINT "POPULATION STARVED PER YEAR ON AVERAGE, I.E., A TOTAL OF" 

865 PRINT Dl"PEOPLE DIEDU H lLET L»A/P 

870 PRINT "YOU STARTED WITH 10 ACRES PER PERSON AND ENDED WITH" 

875 PRINT L"ACRES PER PERSON." IPRINT 

880 IF Pl>33 THEN 565 

885 IF L<7 THEN 565 

890 IF Pl>10 THEN 940 

892 IF L«9 THEN 940 

895 IF Pl>3 THEN 9*0 

896 IF L<10 THEN 960 

900 print "a fantastic performance!! 1 charlemange, disraeli, and" 
905 print "Jefferson combined could not have done betterj"igoto 990 
940 print "your heavy-handed performance smacks of nero and ivan iv." 

945 PRINT "THE PEOPLE (REmAInInG) FInD YOU AN UNPLEASANT RULER, AnD," 

950 PRINT "FRANKLY, HATE YOUR GUTSl"lGQTO 990 

960 PRINT "YOUR PERFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT" 

985 PRINT "REALLY WASN'T TOO BAD AT ALLt "INT(P*.8*RND) "PEOPLE WOULD" 

970 PRINT "DEARLY LIKE TO SEE YOU ASSASSINATED BUT W£ ALL HAVE OUR" 

975 PRINT "TRIVIAL PROBLEMS," 

990 PRINTiFOR Nil TO 10|PRINT CHR$(7)>|NEXT N 

995 PRINT "SO LONG FOR NOW,»|PRINT 

909 END ■ • , ^^ 

129 



HAMURABI: I BEG TO -REPORT TO VOU, 

IN VEAR 1 , PEOPLE STARVED. 5 CAME TO THE CI TV. 

POPULATION IS NOW 100 

THE CI TV NOW OWNS 1600 ACRES. 

VOU HARVESTED 2 BUSHELS PER ACRE. 

RATS ATE 280 BUSHELS. 

VOU NOW HAVE 2800 BUSHELS IN STORE. 

LAND IS TRADING AT 17 BUSHELS PER ACRE. 
HOW MRNV ACRES DO VOU WISH TO BUV? 20 

HOW MANV BUSHELS' DO VOU WISH TO FEED VOUR PEOPLE? 1900 

HOW MANV ACRES DO VOU WISH TO PLANT WITH SEED? 1800 

BUT VOU ONLV HAVE 100 PEOPLE TO TEND THE FIELDS. NOW THEN, 

HOW MANV ACRES DO VOU WISH TO PLANT WITH SEED? 930 



HAMURABI: I BEG TO REPORT TO VOU, 

IN VEAR 2 , 5 PEOPLE STARVED, 11 CAME TO THE CITV. 

POPULATION IS NOW 106 

THE CITV NOW OWNS 1020 ACRES. 

VOU HARVESTED 5 BUSHELS PER ACRE. 

RATS ATE BUSHELS. 

VOU NOW HAVE 5815 BUSHELS IN STORE. 

LAND IS TRADING AT 26 BUSHELS PER ACRE. 
HOW MANV ACRES DO VOU WISH TO BUV? 
HOW MANV ACRES DO VOU WISH TO SELL? 50 

HOW MANV BUSHELS DO VOU WISH TO FEED VOUR PEOPLE? 2120 

HOW MANV ACRES DO VOU WISH TO PLANT WITH SEED? 970 

HAMURABI: I BEG TO REPORT TO VOU, 

IN VEAR 3 , PEOPLE STARVED, 5 CAME TO THE CITV. 

POPULATION IS NOW 111 

THE CITV NOW OWNS 970 ACRES. 

VOU HARVESTED 2 BUSHELS PER ACRE. 

RATS ATE 1855 BUSHELS. 

VOU NOW HAVE 3795 BUSHELS IN STORE. 

LAND IS TRADING AT 20 BUSHELS PER ACRE. 
HOW MANV ACRES DO VOU WISH TO BUV? 50 

HOW MRNV BUSHELS DO VOU WISH TO FEED VOUR PEOPLE? 2220 

HOW MRNV ACRES DO VOU WISH TO PLANT WITH SEED? 1000 



HAMURABI: I BEG TO REPORT TO VOU, 

IN VEAR 4 , PEOPLE STARVED, 2 CAME TO THE CITV. 

POPULATION IS NOW 112 

THE CITV NOW OWNS 1020 ACRES. 

VOU HARVESTED 1 BUSHELS PER ACRE. 

RATS ATE 8 BUSHELS. 

VOU NOW HAVE 1075 BUSHELS IN STORE. 

LAND IS TRADING AT 21 BUSHELS PER ACRE. 
HOW MANV ACRES DO VOU WISH TO BUV? 
HOW MANV ACRES DO VOU WISH TO SELL? 58 

HOW MANV BUSHELS DO VOU WISH TO FEED VOUR PEOPLE? 2208 
HAMURABI: THINK AGAIN. VOU HAVE ONLV 
2125 BUSHELS OF GRAIN. NOW THEN, 

HOW MANV BUSHELS DO VOU WISH TO FEED VOUR PEOPLE? 1500\0051\1725 

HOW MRNV ACRES DO VOU WISH TO PLANT WITH SEED? BOO 
HAMURABI: THINK AGAIN. VOU HAVE ONLV 
408 BUSHELS OF GRAIN. NOW THEN, 

HOW MANV ACRES DO VOU WISH TO PLANT WITH SEED? 790 



HAMURABI: I BEG TO REPORT TO VOU, 

IN VEAR 5 , 27 PEOPLE STARVED, 2 CAME TO THE CITV. 

fl HORRIBLE PLAGUE STRUCK! HALF THE PEOPLE DIED. 

POPULATION IS NOW 44 

THE CITV NOW OWNS 970 ACRES. 

VOU HARVESTED 2 BUSHELS PER ACRE. 

RATS ATE 2 BUSHELS. 

VOU NOW HAVE 2373 BUSHELS IN STORE. 

LAND IS TRADING AT 26 BUSHELS PER ACRE. 
HOW MANV ACRES DO VOU WISH TO BUV? 
HOW MANV ACRES DO VOU WISH TO SELL? 50 

HOW MANV BUSHELS DO VOU WISH TO FEED VOUR PEOPLE? 880 

HOW MANV ACRES DO VOU WISH TO PLANT WITH SEED? 420 

HAMURABI: I BEG TO REPORT TO VOU, 

IN VEAR 6 , O PEOPLE STARVED, 15 CAME TO THE CITV. 

POPULATION IS NOW 59 

THE CITV NOW OWNS 920 ACRES. 

VOU HARVESTED 5 BUSHELS PER ACRE. 

RATS ATE 1289 BUSHELS. 

VOU NOW HAVE 2429 BUSHELS IN STORE. 

LAND IS TRADING AT 22 BUSHELS PER ACRE. 
HOW MRNV ACRES DO VOU WISH TO BUV? 
HOW MANV ACRES DO VOU WISH TO SELL? 

HOW MANV BUSHELS DO VOU WISH TO FEED VOUR PEOPLE? 113i 

HOW MANV ACRES DO VOU WISH TO PLANT WITH SEED? 580 



HAMURABI: I BEG TO REPORT TO VOU. 

IN VEAR 7 , O PEOPLE STARVED, 12 CAME TO THE CITV. 

POPULATION IS NOW 71 

THE CITV NOW OWNS 920 ACRES. 

VOU HARVESTED 3 BUSHELS PER ACRE. 

RATS ATE O BUSHELS. 

VOU NOW HAVE 3789 BUSHELS IN STORE. 



HOCKEY 



ICE HOCKEY VS. CORNELL 



Description 



This is a simulation of a regulation, three-period ice hockey 
game. Your opponent is Cornell University. You may use three 
kinds of shots: 

1. Slap Shot 

2. Flick Shot 

3. Wrist Shot 

The game is very comprehensive starting with the face-off , and 
throughout the game with icing and high sticking penalties, 
shots hitting the post, shots being wide and being blocked 
by the goalie. 

In the event of a tie at the end of three periods, the game 
automatically goes into sudden-death overtime. 

Program Author 

Thanks to Mrs. Kingsley Norris for submitting the program. 
It was written by: 

Charles Buttrey 
Eaglebrook School 
Deerfield, MA 01342 




130 



PROGRAM LISTING 



10 

20 

30 

40 

50 

60 

70 

90 

100 

110 

120 

130 

140 

150 

160 

170 

180 

190 

200 

210 

220 

230 

240 

250 

260 

270 

280 

290 

300 

310 

320 

330 

340 

350 

360 

370 

380 

390 

400 

410 

420 

430 

440 

450 

460 

470 

460 

490 

500 

510 

520 

530 

540 

550 

560 

570 

580 

590 

600 

610 

620 

630 

640 

650 

660 

670 

680 

690 

700 

710 

720 

730 

740 

750 

760 

77Z 

780 

790 

800 

810 

820 

830 

840 

850 

860 

870 

880 

890 

900 

910 

920 

930 

940 

950 

960 

970 

980 

990 

1000 

1010 

1020 

1030 

1040 

1050 

1060 

1070 

1080 

1090 

1100 

1110 

1120 

1130 

1140 

1150 

1160 

1170 



LET A1*INT(14*RNDCX)*6) 

LET X«l 

REM *♦* CONVERTED FROM BRAND X TO DIGITAL RSTS/E BY DAVID AHL 

PRINT " N,B, THIS PROGRAM IS DESIGNED FOR THOSE WHO KNOW NOTHING" 

PRINT » ABOUT HOCKEY LIKE MYSELF. — C. BUTTREY" 

PRINT ■■ THIS IS CORNELL U, HOCKEY," 

PRINT « I AM CORNELL* WHO ARE YOU"! 

INPUT AS 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 



YOU HAVE THREE 8H0TSI" 

1. SLAP SHOT." 

2. FLICK SHOT." 

3. WRIST SHOT," 

HERE IS THE FACE-OFFi" 
SCORE!" 



CORNELL "A 
"AS" "B 
IF X»2 THEN 240 
IF X*3 THEN 260 
IF A+B >• Cl/3*At) THEN 1560 
GOTO 290 

IF A*B >■ (2/3*Al) THEN 1630 
GOTO 290 

IF (A*B) >« (Al) THEN 1710 
GOTO 290 

IF B-3 THEN 1560 
LET C»INTC2*RNDCX)+1) 
IF C«l THEN 330 

PRINT " "A$" WINS THE FACE-OFF," 
GOTO 650 

PRINT « CORNELL TAKES THE FACE-OFF," 
LET D»INTC3*RNDCXH1) 
IF DM THEN 500 
IF D-2 THEN 570 
PRINT "WRIST SHOT,.," 
LET E"INT(5*RNDCX)*1) 
IF E»4 THEN 470 
PRINT « SHOT IS MISSED," 
LET F«INT(2*RND(X)+1) 
IF F»l THEN 450 

PRINT " CORNELL REGAINS THE PUCK," 
GOTO 340 

PRINT « »A$« TAKES THE PUCK." 
GOTO 650 

PRINT " **GOOD1**« 
LET A«A+i 
GOTO 160 

PRINT " SLAP SHOT,,," 
LET Ci«INT(3*RN0(X)*l) 
IF Cl«2 THEN 540 
GOTO 560 

PRINT » ICING PENALTY " 

GOTO 450 

GOTO 360 

PRINT » FLICK SHOT,." 

LET Sl"INTC3*RND(X)+i) 

IF Si*3 THEN 610 

GOTO 640 

PRINT " PENALTY FOR HIGH STICKING! CORNELL MAN PUT IN BOX FOR" 

PRINT " TWO MINUTESJ" 

GOTO 1110 

GOTO 380 

PRINT " YOUR SHOT"! 

INPUT G 

IF G*l THEN 720 

IF G»2 THEN 900 

IF G»3 THEN 970 

PRINT " INPUT EITHER 11' '21 OR »3»« 

GOTO 650 

PRINT « SLAP SHOT," 

LET Zl«INT(3*RNO(X)+l) 

IF Zl«2 THEN 760 

GOTO 780 

PRINT " ICING PENALTY,.,,," 

GOTO 1090 

LET H«INT(5*RND(X)+i) 

IF H«i THEN 870 

PRINT « SHOT IS WIDE," 

LET I»INT(2*RND(X)*1) 

IF 111 THEN 850 

PRINT " CORNELL TAKES THE PUCK," 

GOTO 990 

PRINT " "AS" REGAINS THE PUCK," 

GOTO 650 

PRINT " **GQUD1**" 

LET B«B*i 

GOTO 160 

PRINT " FLICK SHOT.,,," 

LET B1*INTC3*RND(X)*1) 

IF Bl«l THEN 940 

GOTO 960 

PRINT " ICING PENALTY « 

GOTO 830 

GOTO 780 

PRINT « WRIST SHOT,," 

GOTO 780 

PRINT " CORNELL SHOTi" 

LET J«INT(3*RNDCX)*1) 

IF J»i THEN 1160 

IF J-2 THEN 1210 

PRINT » SLAP SHOT," 

LET K»!NTC5*RND(X)*1> 

IF K«l THEN 1130 

PRINT « SHOT HITS THE POST," 

LET L»INT(2*RND(X)*1) 

IF L«l THEN 1110 

PRINT « CORNELL REGAINS THE PUCK," 

GOTO 990 

PRINT " "AS" REGAINS THE PUCK," 

GOTO 1310 

PRINT » **GOODl**" 

LET A»A + 1 

GOTO 160 

PRINT " WRIST SHOT" 

LET M«INT(5*RND(X)M) 



1180 
1190 
1200 
1210 
1220 
1230 
1240 
1250 
1260 
1270 
1280 
1290 
1300 
1310 
1320 
1330 
1340 
1350 
1360 
1370 
1380 
1390 
1400 
1410 
1420 
1430 
1440 
1450 
1460 
1470 
1480 
1490 
1500 
1510 
1520 
1530 
1540 
1550 
1560 
1570 
1580 
1590 
1600 
1610 
1620 
1630 
1640 
1650 
1660 
1670 
1680 
1690 

i; 



17 

17 

17 

17 

17 

17 

17 

17 

17 

1800 

1810 

1820 

1830 

1840 

1850 

1860 

1870 

1880 

1890 

1900 

1910 

1920 

1930 

1940 

1950 

1960 

1970 

1980 

1990 

2000 

2010 

2020 

2030 

2040 

2050 

2060 

2070 

2080 

2090 

2100 

2110 

2120 

2130 

2140 

2150 

2160 

2170 

2180 

2190 

2200 

2210 

2220 

2230 

2240 

2250 

2260 

2270 

2280 

2290 

2300 



IF M»5 THEN 1130 
PRINT » SHOT IS HIGH," 
GOTO 1070 

PRINT « FLICK SHOT" 
LET T1»INTC3*RND(X)+1) 
IF Tl»l THEN 1250 
GOTO 1270 

PRINT " ICING PENALTY « 

GOTO 450 

LET N*INT(5*RND(X)+1) 

IF N"l THEN 1130 

PRINT " SHOT IS BLOCKED BY THE GOALIE," 

GOTO 1070 

PRINT " YOUR SHOT"! 

INPUT 

IF 0*1 THEN 1430 

IF 0«2 THEN 1540 

PRINT " WRIST SHOT." 

LET P»INT(5*RND(X)*1) 

IF Pi2 THEN 870 

PRINT " SHOT IS BARELY WIDE,,," 

LET Q«INT(3*RND(X)+1) 

IF Q»l THEN 830 

PRINT « "A$" REGAINS THE PUCK," 

GOTO 650 

PRINT " SLAP SHOT" 

LET D1«INT(3*RND(X)*1) 

IF Dl»3 THEN 1470 

GOTO 1500 

PRINT " PENALTY FOR HIGH STICKING; «A$" MAN PUT IN PENALTY" 

PRINT " BOX FOR TWO MINUTES" 

GOTO 830 

LET R»INT(5*RND(X)M) 

IF R«l THEN 870 

PRINT « SHOT IS TAKEN BY THE CORNELL GOALIE," 

GOTO 830 

PRINT " FLICK SHOT" 

GOTO 1500 

PRINT « ***** END OF FIRST PERIOD *****" 

LET X«2 

PRINT 

PRINT 

PRINT 

PRINT 

GOTO 160 

PRINT 

LET X«3 

PRINT " SCQREI" 

CORNELL "A 

"AS" "8 



SCOREJ" 
CORNELL "A 
"A$« "B 

START OF SECOND PERIOD," 

***** END OF SECOND PERIOD *****" 



START OF THIRD PERIOD," 



PRINT 

PRINT 

PRINT 

PRINT 

GOTO 160 

PRINT " ***** END OF GAME 

IF A*B THEN 1770 

PRINT " FINAL SCORE:" 

CORNELL "A 

"AS" «B 



PRINT 

PRINT 

STOP 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 



SINCE SCORE IS TIED 
INTO SUDDEN-DEATH!" 
HERE IS THE FACE-OFF," 
SCORE:" 
CORNELL "A 
■AS" "B 

LET 3»INT(2*RND(X)*1) 

IF S«l THEN 1870 

PRINT " "AS" WINS THE FACE»OFF," 

GOTO 2080 

PRINT " CORNELL WINS THE FACE-OFF, 

LET T»INT(3*RND(Xm) 

IF T«l THEN 2040 

IF T«2 THEN 2060 

PRINT " WRIST SHOT," 

LET U«INT(5*RND(X)+1) 

IF U*l THEN 2010 

PRINT " SHOT IS MISSED," 

LET V"INT(2"*RN0(X) + 1) 

IF V»l THEN 1990 

PRINT » "AS" TAKES THE, PUCK," 

GOTO 2080 

PRINT » CORNELL REGAINS THE PUCK," 

GOTO 1880 

PRINT " **GOODl**" 

LET A«A+1 

GOTO 2260 

PRINT " SLAP SHOT" 

GOTO 1920 

PRINT " FLICK SHOT," 

GOTO 1920 

PRINT " YOUR SHOT"! 

INPUT W 

IF w»l THEN 2220 

IF W«2 THEN 2240 

PRINT "WRIST SHOT," 

LET Y"INT(5*RND(X)*1) 

IF Y*4 THEN 2190 

PRINT " SHOT IS MISSED," 

LET Z"INT(2*RND(X)*1) 

IF Z"l THEN 1990 

GOTO 1970 

PRINT " **GOODl**« 

LET B"B+1 

GOTO 2260 

PRINT » SLAP SHOT," 

GOTO 2130 

PRINT " FLICK SHOT," 

GOTO 2130 

PRINT .» GAME IS OVERU" 

PRINT " FINAL SCOREi" 

PRINT " CORNELL "A 

PRINT " "AS" »B 

END 



WE WILL HAVE TO GO" 



131 



SAMPLE RUN 

N. B. THIS PROGRAM IS DESIGNED FOR THOSE WHO KNOW NOTHING 

ABOUT HOCKEV LIKE MVSELF. — C. BUTTREV 

THIS IS CORNELL U. HOCKEV. 

I AM CORNELL, WHO ARE VOU? HARVARD 

VOU HAVE THREE SHOTS: 

1. SLAP SHOT. 

2. FLICK SHOT. 

3. WRIST SHOT. 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 8 

HARVARD O 

HARVARD WINS THE FACE-OFF. 

VOUR SHOT? 1 

SLAP SHOT. 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT. ... 

ICING PENALTV 

CORNELL TAKES THE PUCK. 
CORNELL SHOT: 
FLICK SHOT 

ICING PENALTV 

HARVARD TAKES THE PUCK. 

VOUR SHOT? 3 

WRIST SHOT. . 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT. 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE: 

CORNELL 8 

HARVARD 1 

HARVARD WINS THE FACE-OFF. 

VOUR SHOT? 3 

WRIST SHOT. . 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT. . . . 

ICING PENALTV 

CORNELL TAKES THE PUCK. 
CORNELL SHOT: 
FLICK SHOT 

ICING PENALTV 

HARVARD TAKES THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT. 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 6 

HARVARD 2 

CORNELL TAKES THE FACE-OFF. 

WRIST SHOT. . . 

SHOT IS MISSED. 

CORNELL REGAINS THE PUCK. 

WRIST SHOT. . . 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 1 

HARVARD 2 

CORNELL TAKES THE FACE-OFF. 

WRIST SHOT. 

SHOT IS MISSED. 

HARVARD TAKES THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT. 

SHOT IS WIDE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT; 

FLICK SHOT 

SHOT IS BLOCKED BV THE GOALIE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT 

SHOT IS TAKEN BV THE CORNELL GOALIE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

SLAP SHOT. 

SHOT HITS THE POST. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 3 

WRIST SHOT. 

SHOT IS BARELV WIDE.\ . 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 3 

WRIST SHOT. . 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT. ... 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT. 

SHOT IS WIDE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

SLAP SHOT. 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 2 

HARVARD 2 

CORNELL TAKES THE FACE-OFF. 

WRIST SHOT. . . 

SHOT IS MISSED. 

HARVARD TAKES THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT. 



ICING PENALTV 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

SLAP SHOT. 

SHOT HITS THE POST. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE: 

CORNELL 2 

HARVARD 3 

HARVARD WINS THE FACE-OFF. 

VOUR SHOT? 3 

WRIST SHOT. . 

SHOT IS WIDE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

FLICK SHOT 

SHOT IS BLOCKED BV THE GOALIE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT 

SHOT IS TAKEN BV THE CORNELL GOALIE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

WRIST SHOT 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 3 

HARVARD 3 

***** END OF FIRST PERIOD ***** 
SCORE : 
CORNELL 3 
HARVARD 3 

START OF SECOND PERIOD. 
HERE IS THE FACE-OFF: 
SCORE : 
CORNELL 3 
HARVARD 3 

HARVARD WINS THE FACE-OFF. 
VOUR SHOT? 1 
SLAP SHOT. 
SHOT IS WIDE. 
CORNELL TAKES THE PUCK. 
CORNELL SHOT: 
FLICK SHOT 

SHOT IS BLOCKED BV THE GOALIE. 
CORNELL REGAINS THE PUCK. 
CORNELL SHOT: 
FLICK SHOT 

ICING PENALTV 

HARVARD TAKES THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT. ... 

SHOT IS WIDE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

SLAP SHOT. 

SHOT HITS THE POST. 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

FLICK SHOT 

SHOT IS BLOCKED BV THE GOALIE. 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

WRIST SHOT 

SHOT IS HIGH. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 3 

WRIST SHOT. 

SHOT IS BARELV WIDE. . . 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT. ... 

ICING PENALTV 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

WRIST SHOT 

SHOT IS HIGH. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT 

SHOT IS TAKEN BV THE CORNELL GOALIE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

SLAP SHOT. 

SHOT HITS THE POST. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 3 

HARVARD 4 



CORNELL TAKES THE FACE-OFF. 
SLAP SHOT. . . 

ICING PENALTV 

HARVARD TAKES THE PUCK. 

VOUR SHOT? 3 

WRIST SHOT. . 

SHOT IS WIDE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT : 

SLAP SHOT. 

SHOT HITS THE POST. 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

FLICK SHOT 

SHOT IS BLOCKED BV THE GOALIE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT 

SHOT IS TAKEN BV THE CORNELL GOALIE. 

CORNELL TAKES THE PUCK. 

CORNELL SHOT: 

WRIST SHOT 

**QOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE: 

CORNELL 4 

HARVARD 4 

HARVARD WINS THE FACE-OFF. 

VOUR SHOT? 2 

FLICK SHOT. ... 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT. ... 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 4 

HARVARD 5 

CORNELL TAKES THE FACE-OFF. 

SLAP SHOT. . . 

SHOT IS MISSED. 

HARVARD TAKES THE PUCK. 

VOUR SHOT? 3 

WRIST SHOT. . 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE : 

CORNELL 4 

HARVARD 6 

HARVARD WINS THE FACE-OFF. 

VOUR SHOT? 1 

SLAP SHOT. 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT. 

ICING PENALTV 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

WRIST SHOT 

SHOT IS HIGH. 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

FLICK SHOT 

SHOT IS BLOCKED BV THE GOALIE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 3 

WRIST SHOT. 

SHOT IS BARELV WIDE. . . 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 2 

FLICK SHOT. ... 

SHOT IS WIDE. 

HARVARD REGAINS THE PUCK. 

VOUR SHOT? 1 

SLAP SHOT. 

ICING PENALTV 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

WRIST SHOT 

SHOT IS HIGH. 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT : 

SLAP SHOT. 

SHOT HITS THE POST. 

CORNELL REGAINS THE PUCK. 

CORNELL SHOT: 

WRIST SHOT 

**GOOD ! ** 

HERE IS THE FACE-OFF: 

SCORE: 

CORNELL 5 

HARVARD 6 

***** end OF SECOND 'PERIOD ***** 

SCORE: 

CORNELL 5 

HARVARD 6 



132 



HORSES 



BETTING AT A HORSERACE 



Description 



This program simulates a one-mile horse race for three-year old 
thoroughbreds. You can place any number of bets on the outcome 
of the race. There are four elements to a bet: 

1. Horse number (1 to 8) 

2. Position (Win=l, Place=2, Show=3) 

3. Amount of wager ($2 minimum, $300 maximum) 

4. Bet signal (1 for more bets to follow/ to close 
betting) 

The computer then gives you the position of the eight horses at 
eight points around the raceway. At the end, it tells you what 
each horse paid and what you won (or didn't win) on each of your 
bets. 

Source 

The published program has been around DIGITAL for as long as 
anyone can remember. Its author is now unknown. Other interest- 
ing horse race programs were submitted by Robert Goodman, 
Southfield, Mich.; Don Viola, Staten Island, NY; and Paul 
Garmon, Wellesley Hills, Mass. 




133 



PROGRAM LISTING 



SAMPLE RUN 



1 DIM V(i0),U(t0),T(i0)>M<8),Q(8),HC8),B<8),PC6) 

2 RANDOMIZE V PRINT "HORSE RACE" 

3 PRINT "EXAMPLE OF BETf l;2»200»0 •" 

5 PRINT \ PRINT" SEVENTH - i MILE, 3 YR. OLDS POST 2135" 

6 PRINT 

7 FOR I»l TO 8 

8 B(I)«I \ GOSUB 210 

9 READ o(H V PRINT OCI)":i" 

10 M(I)«(100*50*O(D) / (0(l)*t) 

11 NEXT I 

12 PRINT 

13 PRINt«EN T ER H0R3E(1«8)It0 WIN, PLACE, SHOw( 1,2,3) J AND THE wAGER," 

14 PRINT "AND FOR NO MORE BEyTlNC -OR 1 OR MORE BETTING." 

15 LET S ■ 

16 PRINT 

17 LET S ■ S ♦ 1 

18 PRINT»BET NO. ">S> 

19 INPUT T(S),U(S),VCS),M 

20 LET TCS)«AB8CINTCTCS)n 

21 IF T(S)>8 THEN 26 

22 IF T(S)<1 THEN 26 

23 LET U(S)«ABS(INT(U(S))) 

24 IF U(S)>3 THEN 26 

25 IF U(S)>0 T H EN 2% 

26 pr!nT»Horse no. or hin-place-sHow x n Error" \ Go To 18 

28 IF V(S)<2 THEN 30 

29 iF V(S)<«300 THEN 33 

30 PR!NT«BET MUST BE >$2 AnD <$300, BET AGA IN "I 

31 INPUT V(S) \ GO TO 28 
33 IF H i 1 THEN 17 

35 PRINT \ PRINT" THEY'RE OFF AND RUNNING •" V PRINT 

3e FOR I«l TO 8 N H(I)«0 \ NEXT I 

40 FOR Ml TO 8 

42 SLEEP 6 

44 FOR J«i TO 8 

46 H(J)«H(J)+RNDC0)*M(J) 

48 NEXT J 

52 for i"8 to i step »i 

54 FOR J«2 TO I 

56 ON SGN(H(B(J-i))-H(B(J)))4-2 GO TO 60,58,62 

58 IF RND(0)>,5 THEN 62 

60 2«B(J-1) \ B(J-l)«BCJ) \ BCJ)«Z 

62 NEXT J 

64 NEXT I 

68 PRINT \ PRINT » "I 

70 ON K GOTO 72,74,76,78,80,82,84,86 

72 PRINT "As THEY BREAK FROM tHE GAtE" \ GO TO 88 

74 PRINT "At THE 1/4 MILE POLE" A GO T° 88 

76 PRINT "NEARlNG THE HALFWAY MARK" \ G TO 88 

78 PRINT "MIDWAY In THE RACE" V Co TO 88 

80 PRJNT "AT 5/8 OF A MilE" A GO TO 88 

82 PRINT "ROUNDING THE TURN" \ GO TO 88 

84 PRINT "COMING DOWN The STReTCh" \ GO TO 88 

86 PRINT " FINISH" 

88 REM 

90 GO SUB 200 

92 NEXT K ^ 

96 PRINT \ PRINT \ PRINT "82 MUTUElS PAIDJ" 

98 PRINT " STRAIGHT PLACE SHOW" 

100 K"0 

102 FOR 1.1 TO 3 

104 GO SUB 215 

106 FOR J«I TO 3 

108 L«2*I+J-3 N P(L)«1.5+ti*INT(.i*INT((4*OCB(I))/(J*CJ+l))+RND(0))*100+5)5 

110 PRINT TABC3"t-10*J); \ B»-16 

112 FOR M»3 TO *l STEP -l 

114 P«INT(P(L)/Ci0AM)) 

116 P»P-10*INT(P/10) 

117 IF P«0 THEN 118 \ B»0 

118 PRINT CHR$(48+p+B)| 

138 IF M<>0 THEN 139 S PRINT ",«) 

139 NEXT H 

140 PRINT "0"! 
142 NEXT J 
144 PRINT 

146 NEXT I 

150 PRINT \ Q«0 

152 FOR J«l TO S 

154 PrINt "BET NO, »J J 

156 p«0 

158 FOR III TO 6 \ H(B(I))iI \ NEXT I 

160 IF UCJ)<H(TCJ)) THEN 166 

162 P. ,01*INT((.V(J)*50)*P(U(J)*H(T(J))*2-3)J ■ 

164 PRINT "YOU COLLECT" P "ON «> \ GO TO 172 

166 IF H(T(J))>3 THEN 166 \ PRINT "NEXT TIME, BUY A SHOW«j \ GO TO 170 

168 PRINT "TEAR UP YOUR"; 

170 PRINT « TICKET ON nj 

172 I«0 \ B(0)»T(J) \ GOSUB 215 \ PRINT 

174 Q»Q+P-V(J) 

176 NEXT J 

178 IF Q<0 THEN 182 

180 PRINT "YOUR TOTAL WINNINGS AMOUNT TO $" Q S STOP 

182 PRINT "YOUR TOTAL LOSSES AMOUNT TO S« ABS(O) A STOP 

200 PRINT "POS, HORSE LENGTHS BEHIND" 

205 FOR I«l TO 8 

210 PRINT II 

215 ON BCD GOTO 220,222,224,226,228,230,232,234 

220 PRINT "MAN O'WAR "j \ GO TO 240 

222 PRINT "CITATION •«; \ GO TO 240 

224 PRINT "WHIRLAWAY "| \ GO TO 240 

226 PRINT "ASSAULT «> \ GO TO 240 

228 PRINT «SEABISCUIT «| \ GO TO 240 

230 PRINT tGALLANT FOX'iJ \ GO TO 240 

232 PRINT "STyMIE «t \ GO TO 240 

234 PRINT "COALTOwN «| 

240 IF K«0 THEN 260 

245 IF I>1 THEN 250 \ PRInT \ Go Tn 255 

250 PRINT ..1*INT(H(B(1))-HCB(I))) 

255 NEXT I 

260 RETURN 

301 DATA 3, 4, 5#8, 9, 11,20,30 

999 END 



POST 2:25 



HORSE RACE 

EXAMPLE OF BET; 1,2,200,0 

SEVENTH - 1 MILE, 3 VR. OLDS 

1 MAN O'WAR 

2 CITATION 

3 WHIRLAWAV 5 :1 

4 ASSAULT 8 :i 

5 SEABISCUIT 9 :1 

6 GALLANT FOX 11 :1 

7 STVMIE 29 :1 
3 COALTOWN 20 :1 



ENTER H0RSE<1-3>;T0 WIN, PLACE, SHOWd, 2, 3); AND THE WAGER. 
AND O FOR NO MORE BETTING OR 1 OR MORE BETTING. 



BET NO. 


1 ? 


2,1,100,1 


BET NO. 


2 ? 


2, 2, 100, 1 


BET NO. 


2 ? 


4,2,100,1 


BET NO. 


4 ? 


1,2,100,1 


BET NO. 


.5 ? 


5, 2, 100, O 



THEY'RE OFF AND RUNNING 



AS THEV BREAK FROM THE GATE 
POS. HORSE LENGTHS BEHIND 
1 WHIRLAWAV 



2 SEABISCUIT 


1. 2 


3 STVMIE 


1. 9 


4 GALLANT FOX 


2. 3 


5 ASSAULT 


2. 5 


6 CITATION 


4. 5 


7 MAN O-WAR 


4. 7 


8 COALTOWN 


5. 1 


AT THE 1/4 


MILE POLE - 


POS. HORSE 


LENGTHS BEHIND 


1 STVMIE 




2 WHIRLAWAV 


. 2 


3 CITATION 


. 5 


4 GALLANT FOX 


. 7 


5 COALTOWN 


1. 7 


6 SEABISCUIT 


2. 1 


7 MAN O-WAR 


3.7 


3 ASSAULT 


4. 2 



NEARING THE HALFWAV MARK - 
POS. HORSE LENGTHS BEHIND 

1 CITATION 

2 STVMIE .8 

3 GALLANT FOX 

4 ASSAULT 



5 WHIRLAWAV 

6 COALTOWN 

7 SEABISCUIT 
3 MAN O'WAR 



. 1 
4. 1 
4. 2 

4. 9 

5. 1 
8. 2 



ROUNDING THE TURN - 
POS. HORSE LENGTHS BEHIND 
1 WHIRLAWAV 



2 GALLANT FOX 


1. 6 


3 STVMIE 


2. 2 


4 ASSAULT 


2. 9 


5 CITATION 


5. 6 


6 SEABISCUIT 


6.6 


7 COALTOWN 


10. 9 


8 MAN O'WAR 


11 


COMING DOWN 


THE STRETCH - 


POS. HORSE 


LENGTHS BEHIND 


1 WHIRLAWAV 




2 STVMIE 





2 CITATION 


1. 8 


4 GALLANT FOX 


2. 1 


5 ASSAULT 


2. 8 


6 SEABISCUIT 


6. 8 


7 MAN O'WAR 


8. 4 



8 COALTOWN 



10. 7 



FINISH 
POS. HORSE LENGTHS BEHIND 

1 CITATION 

2 STVMIE . 7 

3 WHIRLAWAV 1. 1 

4 GALLANT FOX 3. 3 



ASSAULT 
MAN O-WAR 
SEABISCUIT 



3 COALTOWN 



6. 4 
10. 2 
10. 5 



*2. MUTUELS PAID: 

STRAIGHT PLAC 
CITATION 9.97 4.44 
STVMIE 15. 4 

WHIRLAWAV 

BET NO. 1 

'YOU COLLECT 498. 5 ON CITATION 

BET NO. 2 

TEAR UP VOUR TICKET ON WHIRLAWAV 

BET NO. 3 

TEAR UP VOUR TICKET ON ASSAULT 

BET NO. 4 

TEAR UP VOUR TICKET ON MAN O'WAR 

BET NO. 5 

TEAR UP VOUR TICKET ON SEABISCUIT 

VOUR TOTAL LOSSES AMOUNT TO * 1. 5 



SHOW 
3. 18 
8. 9 
3. 72 



134 



HURKLE 



FIND THE HURKLE IN HIDING 



Description 

Hurkle? A Hurkle is a happy beast and lives in another galaxy 
on a planet named Lirht that has three moons. Hurkle are 
favorite pets of the Gwik, the dominant race of Lirht and... 
well, to find out more, read "The Hurkle is a Happy Beast" 
in the book A WAY HOME by Theodore Sturgeon published by Pyramid. 

In this program a shy hurkle is hiding on a 10 by 10 grid. 
Homebase is point 0,0 in the Southwest corner. Your guess as 
to the gridpoint where the hurkle is hiding should be a pair 
of whole numbers, separated by a comma. After each try, the 
computer will tell you the approximate direction to go look 
for the Hurkle. You get five guesses to find him. 

NORTH 



WEST 



HOMEBASE' 



9 
8 
7 
6 
5 
4 
3 
2 
1 




EAST 



This is 
Gridpoint 7,3 



4 5 
SOUTH 



8 



9 



Program Author 

Bob Albrecht 

People's Computer Company 

Menlo Park, CA 94025 




135 



PROGRAM LISTING 



SAMPLE RUN 



90 


REM *** CONVERTED- TO RSTS/E BV DAVID AHL, DIGITAL 


100 


REM HURKLE - PEOPLE'S COMPUTER COMPANV, MENLO PARK CA 


105 


RANDOM 


110 


N=5 


120 


6=10 


210 


PRINT 


220 


PRINT "A HURKLE IS HIDING ON ft"; G; "BV"; G; "GRID. HOMEBASE" 


230 


PRINT "ON THE GRID IS POINT 6,8 AND ANV GRIDPOINT IS A" 


240 


PRINT "PAIR OF WHOLE NUMBERS SEPARATED BV A COMMA. TRV TO 


250 


PRINT "GUESS THE HURKLE' S GRIDPOINT. VOU GET"; N; "TRIES. " 


260 


PRINT "AFTER EACH TRV, I WILL TELL VOU THE APPROXIMATE" 


270 


PRINT "DIRECTION TO GO TO LOOK FOR THE HURKLE. " 


2*0 


PRINT 


255 


A=INT<G*RND(0>> 


2*6 


B=INT<G*RND<0>> 


310 


FOR K=l TO N 


320 


PRINT "GUESS #"; K; 


330 


INPUT X, V 


340 


IF ABS<X-A>+ABS<:V-B>=0 THEN 586 


350 


REM PRINT INFO 


360 


GOSUB 610 


370 


PRINT 


380 


NEXT K 


410 


PRINT- 


420 


PRINT "SORRV, THAT'S"; N; "GUESSES. " 


430 


PRINT "THE HURKLE IS AT "; A; ", "; B 


440 


PRINT 


450 


PRINT "LET'S PLAV AGAIN. HURKLE IS HIDING. " 


460 


PRINT 


470 


GO TO 285 


500 


REM 


510 


PRINT 


520 


PRINT "VOU FOUND HIM IN"; K; "GUESSES ! " 


530 


FOR 1=1 TO 10SPRINT CHR*<7>; SNEXT I SPRINT 


540 


GO TO 440 


610 


PRINT "GO "; 


620 


IF V=B THEN 670 


630 


IF V<B THEN 668 


640 


PRINT "SOUTH"; 


650 


GO TO 670 


6€S 


PRINT "NORTH"; 


670 


IF X=A THEN 720 


680 


IF X<fi THEN 710 


690 


PRINT "WEST"; 


700 


GO TO 720 


710 


PRINT "EAST"; 


720 


PRINT 


730 


RETURN 


999 


END 



A HURKLE IS HIDING ON A 10 BV 10 GRID. HOMEBASE 
ON THE GRID IS POINT 0,0 AND ANV GRIDPOINT IS A 
PAIR OF WHOLE NUMBERS SEPARATED BV A COMMA. TRV TO 
GUESS THE HURKLE' S GRIDPOINT. VOU GET 5 TRIES. 
AFTER EACH TRV, I WILL TELL VOU THE APPROXIMATE 
DIRECTION TO GO TO LOOK FOR THE HURKLE. 

GUESS # 1 ? 5, 5 
GO NORTHEAST 

GUESS # 2 ? 7, 7 
GO EAST 

GUESS # 3 ? 8/7 

VOU FOUND HIM IN 3 GUESSES! 

LET'S PLAV AGAIN. HURKLE IS HIDING. 

GUESS # 1 ? 4,4 
GO NORTHWEST 

GUESS # 2 ? 2, 7 
GO NORTHWEST 

GUESS # 3 ? 1, 8 
GO NORTH 

GUESS #4 ? 1, 9 

VOU FOUND HIM IN 4 GUESSES! 

LET'S PLAV AGAIN. HURKLE IS HIDING. 

GUESS # 1 ? 4, 5 
GO SOUTHEAST 

GUESS # 2 ? 7, 2 
GO NORTHWEST 

GUESS # 3 ? 8, 4 
GO SOUTHWEST 

GUESS # 4 ? 6, 3 
GO WEST 

GUESS # 5 ? 5, 3 

VOU FOUND HIM IN 5 GUESSES! 



LET'S PLAV AGAIN. HURKLE I S.HI DING. 

GUESS # 1 ? 4, 8 
GO NORTHWEST 

GUESS # 2 ? 2, 5 
GO NORTH 

GUESS # 3 ? 2, 7 
GO NORTH 

GUESS # 4 ? 2, 8 

VOU FOUND HIM IN 4 GUESSES! 

LET'S PLAV AGAIN. HURKLE IS HIDING. 

GUESS # 1 ? 9, 9 
GO SOUTHWEST 



GUESS # 2 ? 7, 7 
GO SOUTHWEST 



GUESS # 3 ? 5, 5 
GO SOUTHEAST 



GUESS # 4 ? 6, O 
GO NORTH 



GUESS #5 ? 6, 1 
GO NORTH 



SORRV, THAT'S 5 GUESSES. 
THE HURKLE IS AT 6,3 



136 



KINEMA 



THROW A BALL UP IN THE AIR 



Description 

This program tests your fundamental knowledge of kinematics. 
It presents a simple problem: a ball is thrown straight up 
in the air at some random velocity. You then must answer 
three questions about the flight of the ball: 

1. How high will it go? 

2. How long until it returns to earth? 

3. What will be its velocity after a random number of 
seconds? 

The computer evaluates your performance; within 15% of the 
correct answer is considered close enough. After each run, 
the computer gives you another problem until you interrupt 
the program. 

Program Author 

KINEMA was shortened from the original Huntington Computer 
Project Program, KINERV, by: 

Richard F . Pav 
Patchogue High School 

Patchogue, New York a ball is thrown upwards at is meters per second 

HOW HIGH WILL IT GO UN METERS)? 22 

NOT EVEN CLOSE. . . . 

CORRECT ANSWER IS 11. 47959 

HOW LONG UNTIL IT RETURNS (IN SECONDS)? 2 

CLOSE ENOUGH. 

CORRECT ANSWER IS 2. 061225 

WHAT WILL ITS VELOCITY BE AFTER . 2 SECONDS? 1.2 
CORRECT' VERY GOOD 1 



108 PRINT 




195 PRINT 




106 = 




110 V = 5-UNT<25 + RND(0) ) 




111 PRINT "A BALL IS THROWN UPWARDS AT " V " METER'-": PER '-"Ei" 


0ND 


112 PRINT 




115 A=V-2/19. 6 




116 PRINT "HOW HIGH WILL IT GO fIN METERS)"; 




117 GOSUB 5O0 




120 A=V/4. 9 




122 PRINT "HOW LONG UNTIL IT RETURNS (IN SECOND'--)"; 




124 GOSUB 500 




130 T=(1-UNT<2 + V + RND(1) ) )/10 




132 A=V-9. 8*T 




134 PRINT "WHAT WILL ITS VELOCITY BE AFTER - T " SECONDS " ; 




136 GOSUB- 500 




140 PRINT 




150 PRINT G "RIGHT OUT OF 2. "; 




160 IF 0<2 THEN 100 




170 PRINT " NOT BAD. " 




180 GO TO 100 




500 INPUT G 




501 G=100+ABS(G-A> 




502 IF G<=ABS(A) THEN 507 




503 IF G<=15+ABS(A) THEN 5:10 




504 PRINT "NOT EVEN CLOSE. 




506 GO TO 512 




507 G = G + 1 




5 S P R I " C R R E C T ' V E R V G D ' 




509 GOT 05 20 




510 PRINT "CLOSE ENOUGH. " 




511 0=0+1 




512 PRINT "CORRECT ANSWER IS"* 




529 PRINT 




530 RETURN 




3 99 END 





2 RIGHT OUT OF 3. 



A BALL IS THROWN UPWARDS AT 21 METERS PER SECOND 

HOW HIGH WILL IT GO (IN METERS)? 22 

CLOSE ENOUGH. 

CORRECT ANSWER IS 22. 5 

HOW LONG UNTIL IT RETURNS (IN SECONDS)? 4 4 

CLOSE ENOUGH. 

CORRECT ANSWER IS 4. 285714 

WHAT WILL ITS VELOCITY BE AFTER 2. 1 SECONDS? 1 

NOT EVEN CLOSE. . . . 

CORRECT ANSWER I.S . 4200061 



2 RIGHT OUT OF 



A BALL IS THROWN UPWARDS AT 22 METERS PER SECOND 

HOW HIGH WILL IT GO (IN METERS)"' 24.2 

CLOSE ENOUGH. 

CORRECT ANSWER IS 24. 69288 

HOW LONG UNTIL IT RETURNS (IN SECONDS)? 4.4 

CLOSE ENOUGH. 

CORRECT ANSWER IS 4.489796 

WHAT WILL ITS VELOCITY BE AFTER . 2 SECONDS'' 20 
CORRECT 1 VERY GOOD! 



3 RIGHT OUT OF 2. 



137 



KING 



GOVERN YOUR OWN ISLAND 



Description 

This is one of the more comprehensive, difficult , and interesting 
land and resource management games, (If you've never played one 
of these games, start with HMRABI). 

In this game, you are Premier of Setats Detinu, a small communist 
island 30 by 70 miles long. Your job is to decide upon the 
budget of the country and distribute money to your countrymen 
from the communal treasury. 

The money system is Rallods; each person needs 100 Rallods 
per year to survive. Your country's income comes from farm 
produce and tourists visiting your magnificent forests, hunting, 
fishing, etc. Part of your land is farm land but it also has 
an excellent mineral content and may be sold to foreign industry 
for strip mining. Industry import and support their own workers. 
Crops cost between 10 and 15 Rallods per square mile to plant, 
cultivate, and harvest. Your goal is to complete an eight-year 
term of office without major mishap. 

To the question, "HOW MANY TIMES HAVE YOU PLAYED?" answer "0" 
for a full set of rules, "500" for no explanation, or " 1,000" 
to continue an old game. To stop a running game and continue 
it later, answer "0" to all questions. 

This program is available from DECUS as BASIC-8-346, and is 
called "POLLUTION GAME." 

Program Author 

James A. Storer 
Lexington High School 
Lexington, MA 02173 




138 



PROGRAM LISTING 

1 REM JIM STORER 

2 PRINT "HOW MANY TIMES HAVE YOU PLAYED"* 

3 INPUT Z 

5 LET N5«8 

6 RANDOMIZE 

12 IF Z"500 THEN 47 

14 IF Z«1000 THEN I960 

17 FOR Yl»l TO 10 

18 PRINT 

19 NEXT Yl 

20 PRINT "CONGRATULATIONS! yOUiVE BEEN ELECTED PREMIER OF SETATS DETINU," 
22 PRINT "A SMALL CQMMUNI3T ISLAND 30 BY 70 MILES LONG, YOU* JOB IS TO" 
24 PRINT "DECIDE UPON THE COUNTRY'S BUDGET AND DISTRIBUTE M QNEY TO YOUR" 

26 PRINT "COUNTRYMEN FROM THE COMMUNAL TREASURY,"! 

27 IF Z<>0 THEN 47 

28 PRINT " THE MONEY SYSTEM IS RALLODS," 

30 PRINT "AND EACH PERSON NEEDS 100 RALLODS PER YEAR TO SURVIVE," 

32 PRINT "YOUR COUNTRY'S INCOME COMES FROM FARM PRODUCE AND TOURISTS" 

34 PRINT "VISITING YOUR MAGNIFICIENT FORESTS, HUNTING, FISHING, ETC, HALF" 

36 PRINT "YOUR LAND IS FARM LAND WHICH ALSO HAS AN EXCELLENT MINERAL" 

38 PRINT "CONTENT AND MAY BE SOLD TO FOREIGN INDUSTRY (STRIP MINING)" 

39 PRINT "WHO IMPORT AND SUHPORT THEIR OWN WORKERS, CROPS COST BETWEEN" 

40 PRINT "10 AND 15 RALLODS PER SQ, MILE TO PLANT," 

42 PRINT "YOUR GOAL IS TO COMPLETE YOUR" IN5I "YEAR TERM OF OFFICE, "I 
44 PRINT " GOOD LUCKJ" 

47 FOR Yl "1 TO 4 

48 PRINT 

49 NEXT Yl 

50 LET A«INT(6W800+(RnO(1J*J0*I0)-(RnD(1)*1000J) 
55 L.ET B«lNT(500+(R,MD(l)*10i-(RNO(l)*10)) 

65 LET D«2000 

100 LET W«lNTCRNDtn*10 + 95) 

101 FOR Yl«l TO 8 

102 PRINT 

103 NEXT Yl 

105 PRINT "YOU NOW hAVE»ja;"RALLODS IN THE TREASURY," 

110 PRINT INT(B) J"CQUNTRYMES"i 

115 LET V9«INT(C(*NO(l)/2)*10+i05) 

120 IF C»0 THEN 140 

130 PRINT lNT(C)J"FOREIGN WORKERS,"! 

140 PRINT " AKiD»llNT(D)l"SQ. 'MILE8 OF LAND," 

150 PRINT«THIS YEAR INDUSTRY WILL BUY LAND FOR" ! W! "RALLODS PER. SO. MILE," 

155 PRINT "LAND CURRENTLY COSTS" !V9! "RALLODS PER SQ, MILE TO PLANT," 

160 FOR Yl*l TO 3 

162 PRINT 

164 NEXT Yl 

200 PRINT "HO* MANY SQ, MILLS DO YOU WISH TO SELL TO INDUSTRY"! 

210 INPUT H 

215 IF H<0 THEN 200 

220 IF H<sD*1000 THEN 300 

230 PRINT » THINK. AGAINf YOU ' VE ONLY" !D-i 000; "SO. MILES OF FARM LAND" 

240 IF X <> THEN 230 

250 PRINT "(FOREIGN INDUSTRY WILL ONLY BUY FARM LAND BECAUSE FOREST" 

260 PRINT "LAND IS UNECONOMICAL TO STRIP MINE DUE TO TREES," 

270 PRINT "THICKER TOP SOIL, ETC.)" 

280 LET X«l 

299 GOTO 2&tf 

300 LET D«INTCD-H) 
310 LET A«lNT(A+(H*wn 

320 PRINT "HOw MANY RALLODS DO YOU WISH TO DISTRIBUTE TO YOUR COUNTRYMEN"! 

340 INPUT I 

342 IF I<0 THEN 320 

350 IF I<A THEM 402 

360 IF I»A THEN 380 

370 PRINT " THINK AGAIN YOU'VE ONLY" ! A ! "RALLODS IN THE TREASURY" 

375 GOTO 320 

380 LET Js0 

390 LET K*0 

395 LET A.0 

399 GOTO 10y?0 

400 LET A»InT(A-D 

410 PRINT "HQw MANY S(i, MILES DO YOU WISH TO PLANT"! 

420 INPUT J i 

421 IF JO THEN 41H 

422 IF J<«B*2 THEN 426 

423 PRINT " SORRY, BUT EACH COUNTRYMAN CAN ONLY PLANT 2 SO. MILES" 

424 GOTO 410 

426 IF J<«D-1000 THEN 430 

427 PRINT " SORRY, BUT 

428 GOTO 410 
430 LET U1»INT (J*V9) 
435 IF Ui<A THEN 500 
440 IF U1«A THEN 490 
450 PRINT " Think agaIi* 
460 GOTO 410 
490 LET K«0 

495 LET A«0 

499 GOTO 1000 

500 LET A«A-ul 

505 IF D*2000 THEN 1000 

510 PRINT "hO* MANY RALLODS DO YOU «iSh TO SPEND ON POLLUTION CONTROL"! 

520 INPUT K 

522 IF K<0 THEN 510 

530 IF K<*A THEN 100* 

540 PRINT '■'. THINK AGAIN, YOU'VE ONLY" ! A ! "RALLODS REMAINING" 

550 GOTO 510 

600 IF H<>0 THEN 1B02 

602 IF I<>0 THEN 1002 

604 IF J<>0 THEN 1i3'02 

606 IF K<>0 THEN 1002 - ■ 

608 FOR YU1 TO 5 

609 PRINT 

610 NEXT Yl 

612 PRINT "GOODBYE," 

614 PRINT "(IF YOU WISH TO CONTINUE THIS GAME AT A LATER DATE, ANSWER « 

616 PRINT "1000 FOR HOW MANY TIMES YOU'VE PLAYED, AT BEGINNING OF NEXT "! 

617 PRINT "GAME,)" 

618 GOTO 1590 
1000 GOTO 600 

1002 FOR Yl»l TO 3 

1003 PRINT 

1004 NEXT Yl 

1010 LET A*INTCA-K) 

1020 LET A4*A 

1100 IF INT(I/100-B)>«0 THEN U20 

1105 IF I/1B0<50 THEN 1700 

1110 PRINT INT(B-(I/100))!"COUNTRYM£N DIED OF STARVATION" 

1120 LET Fl«INT(RNDU)*(200v4-D)) 

1122 IF K<25 THEN U3fl 

1125 LET Fl»INT(Fl/(K/25)) 

1130 IF Fl<-0 THEN 1150 _ __ 

1140 PRINT Fl!"COUNTRYMEN DIED OF CARBON-MONOXIDE AND OUST INHALATION" 139 



YQU-'VE QNLY"»D-1000?"SQ. mILES OF Farm LAND" 



YOU'Vfc ONLY"!A!"RALLODS LEFT IN THE TREASURY" 



1150 IF INT(CI/100)-B)<0 THEN 1170 

1160 IF Fl>0 THEN 1180 

1165 GOTO 1200 

1170 PRINT " YOU WERE FORCED TO SPEND" ! INT ( (Fl* (B- ( 1/100) ) )*9)! 

1172 PRINT "RALLODS ON FUNERAL EXPENSES," 

1174 LET B5»INT(FU(B«(I/100))) 

1175 LET A»INT(A-((FU(B-(I/100)))*9)) 

1176 GOTO 1185 

1180 PRINT " YOU WERE FORCED TO SP"END W ! JNTCFl*9J| "RALLODS ON «j 

1181 PRINT "FUNERAL EXPENSES," 

1182 LET 85-Fl 

1183 LET A«INT(A-(F1*9)) 
1185 IF A>«0 THEN 1194 

1187 PRINT " INSUFFICIENT RESERVES TO COVER COST -LAND WAS SOLD" 

1189 LET DaINT(D+(A/w)) 

1190 LET A«0 

1194 LET 8»INT(B-B5) 

1200 IF H.0 THEN 1250 

1220 LET C1»INT(H+(RND(1)*10)-(RND(1)*20)) 

1224 IF C>0 THEN 1230 

1226 LET CMC1 + 20 

1230 PRINT C1!"W0RKERS CAME TO THE COUNTRY AND"! 

1250 LET Pl"INT(((I/100-8)/i0)+(K/25)-((2000-D)/50)-(Fl/2)) 

1255 PRINT ABS(P1)!"C0UNTRYMEN «! 

1260 IF Pl<0 THEN 1275 

1265 PRINT "CAME TO"! 

1270 GOTO 1280 

1275 PRINT "LEFT"! 

1280 PRINT » THE ISLAND," 

1290 LET B*INT(B+P1) 

1292 LET C«lNTfC+Cl) 

1305 LET u2«lNT(((-2000-D)*((RNOCl) + l,5)/2))J 

1310 IF C«0 THEN 1324 

1320 PRINT " 0F";INT(J)!"SQ. MILES PLANTED,"! 

1324 IF J>U2 THEN 1330 

1326 LET U2»J 

1330 PRINT " YOU HARVESTED" i INT (J-U2) ! "SQ. mI l ES OF CROPS." 

1340 IF U2*0 THEN 137* 

1344 IF Tl>«2 THEN 1370 

1350 PRINT » (DUE TO "! 

1355 IF T1'«0 THEN 1365 

1360 PRINT "INCREASED «! 

1365 PRINT "AIR AND WATER POLLUTION FROM FOREIGN INDUSTRY.)" 

1367 LET T1»T1M 

1370 LET G*lNT((J-U2)*(W/2)) 

1380 PRINT » MAKlNG"!lNT(9)i"RALL0DS,« 

1390 LET A«INT(A+Q) 

1400 LET vl«INT(((B-Pn*22) + (RND(n*500)) 

1405 LET V2»INT((2000-D)*15) 

1410 PRINT « YOU MADE"!A8S(lNT(Vt-V2))!"RALL0DS FRO* TOURIST TRADE, 

1420 IF V2s0 THEN 1450 

1425 IF V1-V2>«V3 ThEN 1450 

1430 PRINT " DECREASE BECAUSE "» 

1435 LET Gl«RND(l)*i0 

1440 IF Gl<a2 THEN 1460 

1442 IF Gl<»4 THEN 1465 

1444 IF Gl<«6 THEN 1470 

1446 IF Gl<*8 THEN 1475 

1448 IF 6.1<>10 THEN 1480 

1450 LET V3«INT(V1-V2) 

1451 LET A»INT(A+V3) 

1452 GOTO 1500 

1460 PRINT "FISH POPULATION HAS- DWINDLED DUE TO WATER POLLUTION," 

1462 GOTO 1450 

1465 PRINT "AIR POLLUTION IS KILLING GAME BIRD POPULATION," 

1467 GOTO 1450 

1470 PRINT "MINERAL BATHS ARE BEING RUINED BY WATER POLLUTION," 

1472 GOTO 1450 

1475 PRINT "UNPLEASANT SMOG Is DISCOURAGING SUN BATHERS." 

1477 GOTO 1460 

1480 PRINT "HOTELS ARE LOOKING SHABBY DUE TO SMOG GRIT." 

1482 GOTO 1450 

1500 IF B5>200 THEN 1600 

1505 IF B<343 THEN 17*0 

1510 IF (A4/100)>5 THtM igap 

1515 IF C>B THEN 1550 

1520 IF N5-l«*5 THEN 1900 

1545 GOTO 2&»fc 

1550 FOR Yl"! TO 8 

1552 PRINT 

1555 NEXT Yl 

1560 PRINT "THE NUMBER OF FOREIGN WORKERS HAS EXCEEDED THE NUMBER" 

1562 PRINT "OF COUNTRYMEN, AS A MAJORITY THEY HAVE REVOLTED AND" 

1564 PRINT "TAKEN OVER THE COUNTRY," 

1570 IF RND(l)<s # 5 THEN 1580 

1574 PRINT "YOU HAVt BEEN THROWN OUT OF OFFICE AND YOU ARE NOw" 

1576 PRINT "RESIDING IN PRISION," 

1578 GOTO 1690 

1580 PRINT "YOU HAVE BEEN ASSASSINATED," 

1590 FOR Yi" 1 TO 18 

1592 PRINT 

1594 NEXT Yl 

1596 STOP 

1600 FOR Ylsi TO 8 

1602 PRINT 

1605 NEXT Yl 

1610 PRINT B5!"C0UNTYRMEN DIED In ONE YEAR 1 J J J J " 

1615 PRINT "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY" 

1620 PRINT "BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU" 

1622 LET M6«INT(RNQ(1)*10) 

1625 IF M6<b3 TmEN 1670 

1630 IF M6<«6 THEN 1680 

1635 IF M 6 <»i^ THEN 1690 

1670 PRINT "ALSO HAD YOUR LEFT EYE GOUGED OUT," 

1672 GOTO 1590 

1680 PRINT "HAVE ALSO GAINED A VERY BAD REPUTATION," 

1682 GOTO 159^ 

1690 PRINT "HAVE ALSO BEEn DECLARED NATIONAL FIn*." 

1692 GOTO 1590 

1700 FOR Yl»l TO B 

1702 PRINT 

1705 NEXT Yl 

1710 PRINT "OVER ONE THIRD OF THE POPULATION HAS DIED SINCE YOU" 

1715 PRINT "WERE ELECTED TO OFFICE. THE PROPLE (REMAINING)" 

1720 PRINT "HATE YOUR GUTS," 

1730 GOTO 1570 

1800 IF B5-Fl<2 THEN 1515 

1805 FOR Yl«l TO 8 

1807 PRINT 

1810 NEXT Yl 

1815 PRINT "MONEY WAS LEFT OVER IN THE TREASURY WHICH YOU DID" 

1820 PRINT "NOT SPEND, AS A RESULT SOME OF YOUR COUNTRYMEN DIED" 



1825 PRINT "OF STARVATION, THE PUBLIC IS ENRAGED AND YOU HAVE" 

1830 PRINT "BEEN FORCED TO EITHER RESIGN OR COMMIT SuClDE" 

1835 PRINT "THE CHOICE IS YC'uRS." 

1840 PRINT "IF YOU CHOOsE THE LATTER, PLEASE TURN OFF YOUR TTY H I 

1845 PRINT " BEFORE PROCEEDING," 

1850 GOTO 1590 

1900 FOR Yl*l TO 8 

1902 PRINT 

1905 NEXT Yl 

1920 PRINT "CONGRATULATlONSnunnnUHUl" 

1925 PRINT "YOU HAVE SUCCESSFULLY COMPLETED YOUR" J Ng; "YEAR TERM" 

1930 PRINT "OF OFFICE, YOU fcE«E, OF COURSE, EXTREMELY LUCKY, BUT NEVER THE" 

1935 PRINT "LESS, IT'S QUITE AN ACHIEVEMENT, G00D8Y AND GOOD LUCK -YOU«LL« 

1940 PRINT "PROBABLY NEED IT IF YOU'RE THE TYPE THAT PLAYS THIS GAME." 

1945 PRINT » -FOR FURTHER THRILLS, TRY LANDING ON THE MOON" 

1950 GOTO 1590 

1960 PRINT "HOW MANY YEARS HAD YOU BEEN In OFFICE WHEN INTERRUPTED"; 

1961 INPUT X5 

1962 IF X5<0 THEN 1590 

1963 IF X5<8 THEN 1969 

1965 PRINT " COME ON, YOUR TERM OF OFFICE IS ONLY" I N5» "YEARS" 
1967 GOTO 1960 

1969 PRINT "HOW MUCH DID YOl HAVE IN THE TREASURY"! 

1970 INPUT A 

1971 IF A<0 THEN 1590 

1975 PRINT "HO* MANY COUNTRYMEN"! 

1976 INPUT 6 

1977 IF B<0 THEM 1590 

1980 PRINT "HOW MANY WORKERS"! 

1981 INPUT C 

1982 IF C<0 THEN 1590 

1990 PRINT "HOW MANY SO. Mll.Es OF LAND"! 

1991 INPUT D 

1992 IF D<0 THEN 1590 

1993 IF D>2000 THEN 1996 

1994 IF DM00P THEN 100 

1996 PRINT " COME ON, YOl STARTED WITH 1000 SO, MILES OF FAPM LAND" 

1997 PRINT " AND 1000 SQ, MILES OF FOREST LAND" 

1998 GOTO 1990 
2000 LET X5«X5*1 
2020 LET 85»0 
2040 GOTO 100 
2046 END 



SAMPLE RUN 

CONGRATULATIONS! YOU'VE BEEN ELECTED PREMIER OF SETATS DETINU, 
fl SMALL COMMUNIST ISLAND 26 BV 78 MILES LONG, VOUR JOB IS TO 
DECIDE UPON THE COUNTRY'S BUDGET AND DISTRIBUTE MONEV TO VOUR 
COUNTRVMEN FROM THE COMMUNAL TREASURY. THE MONEV SVSTEM IS RALLODS, 
AND EACH PERSON NEEDS 188 RALLODS PER VEAR TO SURVIVE. 
VOUR COUNTRY'S INCOME COMES FROM FARM PRODUCE AND TOURISTS 
VISITING VOUR MAGNIFICIENT FORESTS, HUNTING, FISHING, ETC. HALF 
VOUR LAND IS FARM LAND WHICH ALSO HAS AN EXCELLENT MINERAL 
CONTENT AND MAV BE SOLD TO FOREIGN INDUSTRY (STRIP MINING) 
WHO IMPORT AND SUPPORT THEIR OWN WORKERS. CROPS COST BETWEEN 
10 AND 15 RALLODS PER SO. MILE TO PLANT. 
VOUR GOAL IS TO COMPLETE YOUR S VEAR TERM OF OFFICE. GOOD LUCK! 



VOU NOW HAVE 68259 RALLODS IN THE TREASURY. 

SO? COUNTRVMEN, AND 2O00 SQ. MILES OF LAND. 
THIS VEAR INDUSTRY WILL BUY LAND FOR 184 RALLODS PER S 
LAND CURRENTLY COSTS 18 RALLODS PER SQ. MILE TO PLANT. 



HOW MANV SQ. MILES DO VOU WISH TO SELL TO INDUSTRY? 288 

HOW MANY RALLODS DO YOU WISH TO DISTRIBUTE TO YOUR COUNTRVMEN? 58288 

HOW MANV SQ. MILES DO VOU WISH TO PLANT? 788 

HOW MANV RALLODS DO VOU WISH TO SPEND ON POLLUTION CONTROL? 5888 



314 NORKERS CAME TO THE COUNTRY AND 194 COUNTRVMEN CAME TO THE ISLAND. 
OF 788 SQ. MILES PLANTED, VOU HARVESTED 248 SQ. MILES OF CROPS. 

<DUE TO AIR AND WATER POLLUTION FROM FOREIGN INDUSTRY. ) 
MAKING 13896 RALLODS. 
VOU MADE 6581 RALLODS FROM TOURIST TRADE. 



VOU NOW HAVE 52926 RALLODS IN THE TREASURY. 

696 COUNTRVMEN, 214 FOREIGN WORKERS, AND 1788 SQ. MILES OF LAND. 
THIS VEAR INDUSTRY WILL BUY LAND FOR 182 RALLODS PER SQ. MILE. 
LAND CURRENTLY COSTS 11 RALLODS PER SQ. MILE TO PLANT. 



HOW MANV SQ. MILES DO VOU WISH TO SELL TO INDUSTRY? 288 

HOW MANV RALLODS DO VOU WISH TO DISTRIBUTE TO VOUR COUNTRVMEN? 69668 

HOW MANV SQ. MILES DO VOU WISH TO PLANT? 788 

SORRY, BUT YOU'VE ONLY 488 SQ. MILES OF FARM LAND 
HOW MANV SQ. MILES DO VOU WISH TO PLANT? 488 
HOW MANV RALLODS DO VOU WISH TO SPEND ON POLLUTION CONTROL? 5888 



285 WORKERS CAME TO THE COUNTRY AND 188 COUNTRYMEN CAME TO THE ISLAND. 
OF 488 SQ. MILES PLANTED, VOU HARVESTED 8 SQ. MILES OF CROPS. 

<DUE TO INCREASED AIR AND WATER POLLUTION FROM FOREIGN INDUSTRY. ) 
MAKING 8 RALLODS. 
VOU MADE 6425 RALLODS FROM TOURIST TRADE. 

DECREASE BECAUSE AIR POLLUTION IS KILLING GAME BIRD POPULATION. 



VOU NOW HAVE 12261 RALLODS IN THE TREASURY. 

884 COUNTRYMEN, 599 FOREIGN WORKERS, AND 1488 SQ. MILES OF LAND. 
THIS VEAR INDUSTRY WILL BUY LAND FOR 97 RALLODS PER SQ. MILE. 
LAND CURRENTLY COSTS 12 RALLODS PER SQ. MILE TO PLANT. 



HOW MANV SQ. MILES DO VOU WISH TO SELL TO INDUSTRY? 8 

HOW MANV RALLODS DO VOL! WISH TO DISTRIBUTE TO VOUR COUNTRVMEN? 88488 

THINK AGAIN YOU'VE ONLY 12261 RALLODS IN THE TREASURY 
HOW MANY RALLODS DO VOU WISH TO DISTRIBUTE TO VOUR COUNTRVMEN? 12888 
HOW MANV SQ. MILES DO VOU WISH TO PLANT? 488 

THINK AGAIN, YOU'VE ONLY 261 RALLODS LEFT IN THE TREASURY 
HOW MANY SQ. MILES DO VOU WISH TO PLANT? 28 
HOW MANV RALLODS DO VOU WISH TO SPEND ON POLLUTION CONTROL? 588 

THINK AGAIN, YOU'VE ONLY 21 RALLODS REMAINING 
HOW MANY RALLODS DO VOU WISH TO SPEND ON POLLUTION CONTROL? 21 



764 COUNTRVMEN DIED OF STARVATION 

418 COUNTRVMEN DIED OF CARBON-MONOXIDE AND DUST INHALATION 

VOU WERE FORCED TO SPEND 18566 RALLODS ON FUNERAL EXPENSES. 

INSUFFICIENT RESERVES TO COVER COST -LAND WAS SOLD 
178 COUNTRVMEN LEFT THE ISLAND. 

OF 28 SQ. MILES PLANTED, VOU HARVESTED 8 SQ. MILES OF CROPS. 
MAKING 8 RALLODS. 
VOU MADE 16841 RALLODS FROM TOURIST TRADE. 

DECREASE BECAUSE AIR POLLUTION IS KILLING GAME BIRD POPULATION. 



140 



1174 COUNTVRMEN DIED IN ONE YEAR!!!!! 
DUE TO THIS EXTREME MISMANAGEMENT VOU HAVE NOT ONLY 
BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT VOU 
HAVE ALSO BEEN DECLARED NATIONAL FINK. 



LETTER 



LETTER GUESSING GAME 



Description 



LETTER is similar to the game GUESS in which you guess a number 
chosen by the computer; in this program, the computer picks a 
random letter of the alphabet and you must guess which one it 
is using the clues provided as you go along. It should not 
take you more than five guesses to get the mystery letter. 

Computer Limitations 

This program was adapted for DIGITAL EduSystem 15/30/35 and 
uses the automatic character string to ASCII conversion feature. 
Other systems will require a conversion function as Statement 
435. 

Program Author 

Program modified and adapted from the original written by: 

Bob Albrecht 

People's Computer Company 

Menlo Park, CA 94025 




141 



PROGRAM LISTING 

LETTER EDUSYSTEM 30 

90 RANDOMIZE 

160 PRINT "LETTER GUESSING GAME "SPRINT 

218 PRINT "I'LL THINK OF A LETTER OF THE ALPHABET, A TO 2. ' 

229 PRINT "TRY TO GUESS MY LETTER AND I'LL GIVE YOU CLUES" 

230 PRINT "AS TO HOW CLOSE YOU'RE GETTING TO MY LETTER. " 
310 L=65+INT<RND<0>*26> 

320 G=@ 

340 PRINTSPRINT "OK, I HAVE A LETTER. START GUESSING. " 

410 PRINTSPRINT "WHAT IS YOUR GUESS?".: 

425 G = G+1 

430 INPUT $ASPRINT 

440 IF A=L THEN 500 

450 IF A>L THEN 480 

460 PRINT "TOO LOW. 

430 PRINT "TOO HIGH. 



TRY A HIGHER LETTER. "SGOTO 41© 
TRY A LOWER LETTER. "SGOTO 410 
500 PRINTSPRINT "YOU GOT IT IN"G"GUESSES ! ! " 
504 IF G<=5 THEN 508 

506 PRINT "BUT IT SHOULDN'T TAKE MORE THAN 
508 PRINT "GOOD JOB ! ! ! ! " 
510 FOR N = l TO 15SPRINT CHR#<7>; SNEXT N 
515 PRINT 

520 PRINT "LET'S PLAY AGAIN " 

530 GOTO 310 
999 END 



GUESSES! "SGOTO 515 



SAMPLE RUN 

LETTER EDUSYSTEM 30 

LETTER GUESSING GAME 

I'LL THINK OF A LETTER OF THE ALPHABET, A TO Z. 
TRY TO GUESS MY LETTER AND I'LL GIVE YOU CLUES 
AS TO HOW CLOSE YOU'RE GETTING TO MY LETTER. 

OK, I HAVE A LETTER. START GUESSING. 

WHAT IS YOUR GUESS?M 

TOO LOW. TRY A HIGHER LETTER. 

WHAT IS YOUR GUESS?S 

TOO HIGH. TRY A LOWER LETTER. 

WHAT IS YOUR GUESS7P 

VOU GOT IT IN 3 GUESSES! ! 
GOOD JOB ! ! ! ! 

LET'S PLAY AGAIN 

OK, I HAVE A LETTER. START GUESSING. 

WHAT IS YOUR GUESS?M 

TOO HIGH. TRY A LOWER LETTER. 

WHAT IS YOUR GUESS7F 

TOO HIGH. TRY A LOWER LETTER. 

WHAT IS YOUR GUESS?C 

YOU GOT IT IN 3 GUESSES! ! 
GOOD JOB ! ! ! ! 

LET'S PLAY AGAIN 

OK, I HAVE A LETTER. START GUESSING. 

WHAT IS YOUR GUESS7M 

TOO HIGH. TRY A LOWER LETTER. 

WHAT IS YOUR GUESS?F 

TOO HIGH. TRY A LOWER LETTER. 

WHAT IS YOUR GUESS7C 

TOO HIGH. TRY A LOWER LETTER. 

WHAT IS, YOUR GUESS?B 

VOU GOT IT IN 4 GUESSES! ! 
GOOD JOB ! ! ! ! 

LET'S PLAY AGAIN 

OK, I HAVE A LETTER. START GUESSING. 

WHAT IS YOUR GUESS? 



142 



LIFE 



JOHN CONWAY'S GAME OF LIFE 

Description 

The Game of Life was originally described in Scientific American , 
October 1970, in an article by Martin Gardner. The game itself 
was originated by John Conway of Gonville and Caius College, 
University of Cambridge, England. 

In the "manual" game, organisms exist in the form of counters 
(chips or checkers) on a large checkerboard and die or reproduce 
according to some simple genetic rules. Conway's criteria for 
choosing his genetic laws were carefully delineated as follows: 

1. There should be no initial pattern for which there is 

a simple proof that the population can grow without limit, 

2. There should be initial patterns that apparently do 
grow without limit. 

3. There should be simple initial patterns that grow and 
change for a considerable period of time before coming 

to an end in three possible ways: fading away completely 
(from overcrowding or from becoming too sparse) , settling 
into a stable configuration that remains unchanged 
thereafter, or entering an oscillating phase in which 
they repeat an endless cycle of two or more periods. 

In brief , the rules should be such as to make the behavior of 
the population unpredictable. Conway's genetic laws are de- 
lightfully simple. First note that each cell of the checker- 
board (assumed to be an infinite plane) has eight neighboring 
cells, four adjacent orthogonally, four adjacent diagonally. 
The rules are: 

1. Survivals. Every counter with two or three neighboring 
counters survives for the next generation* 

2 . Deaths . Each counter with four or more ne ighbor s dies 
(is removed) from overpopulation. Every counter with 
one neighbor or none dies from isolation. 

3. Births. Each empty cell adjacent to exactly three 
neighbors— no more, no fewer—is a birth cell. A 
counter is placed on it at the next move. 

It is important to understand that all births and deaths occur 
s imultaneously . Together they constitute a s ingle generation or , 
as we shall call it, a "move" in the complete "life history" 
o f the initial configuration. 



143 



You will find the population constantly undergoing unusual , 
sometimes beautiful and always unexpected change. In a few 
cases the society eventually dies out (all counters vanishing) , 
although this may not happen until after a great many generations, 
Most starting patterns either reach stable figures* — Conway calls 
them "still lifes" — that cannot change or patterns that oscillate 
forever. Patterns with no initial symmetry tend to become 
symmetrical. Once this happens the symmetry cannot be lost, 
although it may increase in richness. 

Conway used a DIGITAL PDP-7 with a graphic display to observe 
long-lived populations. The program here is programmed for a 
RSTS-11 system. You simply input your initial pattern and ter- 
minate your input with a Control/Z. The computer then plots 
successive generations of your population on a 24 (vertical) 
by 70 (horizontal) grid. Sit back and watch it! 

Program Author 

Clark Baker 

Project DELTA 

Delaware School Auxilliary Association 

Newport, Delaware 




2 



© 



PROGRAM LISTING 



1 REM LIFE CLARK BAKER 3/72 C.O.G. 

2 PRINT CHr$(31X)>CHr$(29X)JCHrJC31X)|WENTER YOUR PATTERN!" 

3 XlX,YlX«i! X2X"24Xt Y2X"70X 
10 DIM AX(24X,70X),B$(24X) 

20 OPEN "KBi" AS FILE 1 

30 ON ERROR 60 TO 80 

40 CX«1 

50 INPUT LINE #1,B$(CX)IBSCCX)«LEFT(B$(CX)#LEN(B$(CX))»2X) 

60 CX"CX*1 

70 GO TO 60 

80 LX"0X 

90 FOR X%«1 TO CX*i 

100 IF LEN(B$(XX))>LX THEN L%"LEN(B$(XX)) 

110 NEXT XX 

120 XlX"llX-Cx/2X 

130 YlX"33X«'LX/2X 

140 FOR XX«1 TO CX 

150 FOR YX»t TO LENCBS(XX)) 

160 IF MlDtBS(XX)#YX#l)«>« '• THEN a*<X1X*XX, YiX*YX)"l I PX»PX*1 

170 NEXT YX 

180 NEXT XX 

200 PRINT CHR$(29X)|CHR$(30%) I 

210 PRINT »GENE^RATION|' , |GX,«POPULATIONi«lPX>eHR$(30X)llIF I9X THEN PRINT , "INVALID J "J 

215 X3%"24 x :Y3x«70xtX4x,Y4x«llPx«0X 

220 GX*GX+1% 

225 PRINT CHRS(13X)fCHRS(10X)ICHRS(30X)y FOR XX"1 To XlX'l 

230 FOR XX-X1X TO X2X 

240 PRINT 

250 FOR YX«YlX TO Y2X 

253 IF AX(XX#YX)«2X THEN AX(XX,YX)«0X|GO TO 270 

256 IF AX(XX,YX)«3X THEN AX (XX, YX) "i IGO TO 261 

260 IF AX(XX,YX)<>1 THEN 270 

261 PRINT TA8<YX)»"# H I 

262 IF Xx<X3x THEN X3x«X% 
264 IF X**X4X THEN x4X»x« 
266 IF YX<Y3X t^EN y3X«YX 
268 IF YX>Y4X THE N Y4X«YX 
270 NEXT YX 

280 PRINT CHRS(30X)I 

290 NEXT XX 

2g5 PRINT CHRSC30X) FOR XX«X2X*1 TO 24X 

298 PRINT CHRSC29X)! 

299 XlX«X3X|X2X«X4%lYiX«Y3X'lY2X«Y4% 
301 IF Xl X <3x THEN X 1 X «3x 1 19%-- 1 % 
303 IF x2X>22X THEN X 2X«22X \ I9x«-lX 
305 IF Y1X<3X THEN YlX"3X* I9X--1X 
307 IF Y2X>68X THEN Y2X"68X : I9X«-1X 
309 PX*0X . 

500 FOR XX.X1X-1 TO X2X*1 

510 FOR YX*Y1X«1 TO Y2X+1 

520 CX«0X 

530 FOR IX-XX-lX TO XX+1% 

540 FOR JX»YX»1X TO YX+1X 

550 IF AX(IX,JX)«1X OR AX(IX,JX)»2X THEN CX«CX+1X 

560 NEXT JX 

570 NEXT Ix 

580 IF AX(XX»Y%)"0X THEN 610 

590 IF CX<3% OR CX>4X THEN AX(XX,YX)"2X ELSE PX«PX+1 

600 GO TO 620 

610 IF CX*3X THEN AX(XX, YX) «3XIPX*PX+1 

620 NEXT YX 

630 NEXT XX 

635 XlX«XlX-liYtX»YlX-liX2X«X2X+llY2X«Y2X+l 

640 GO TO 210 

650 END 



GENERRTION: 2 



POPULATION: ? 



GENERATION: 20 



POPULAT I ON : 



SAMPLE RUN 

ENTER VOUR PATTERN: 



GENERATION: 21 



POPULATION: 2? 



GENERRTION: & 



POPULATION: 5 



GENERATION: 22 



POPULATION: 37 



GENERRTION: 1 



POPULATION: 6 






145 



LIFE-2 



2 -PERSON GAME OF LIFE 



Description 



LIFE-2 is based on Conway's game of Life. You must be familiar 
with the rules of LIFE before attempting to play LIFE-2. 

There are two players; the game is played on a 5x5 board and each 
player has a symbol to represent his own pieces of 'life 1 . Live 
cells belonging to player 1 are represented by '*' and live cells 
belonging to player 2 are represented by the symbol '#' . 

The # and * are regarded as the same except when deciding whether 
to generate a live cell. An empty cell having twb'-' r #' and one 
**' for neighbors will generate a '#' , i.e. the live cell generated 
belongs to the player who has the majority of the 3 live cells 
surrounding the empty cell where life is to be generated', e.g. 





1 


2 


3 


4 


5 


1 












2 






* 






3 








# 




4 






# 






5 













A new cell will be generated at (3,3) which will be a '#' since 
there are two '#' and one '*' surrounding. The board will then 
become: 





1 


2 


3 


4 


5 


1 












2 












3 






# 


# 




4 












5 













146 



On the first move each player positions 3 pieces of life on the 
board by typing in the co-ordinates of the pieces. (In the event 
of the same cell being chosen by both players that cell is left 
empty . ) 

The board is then adjusted to the next generation and printed out. 

On each subsequent turn each player places one piece on the board, 
the object being to annihilate his opponent's pieces. The board 
is adjusted for the next generation and printed out after both 
players have entered their new piece. 

The game continues until one player has no more live pieces. The 
computer will then print out the board and declare the winner. 

Program Author 

The idea for this game, the game itself, and the above write-up 
were written by: 

Brian Wyvill 
Bradford University 
Bradford, Yorkshire, England 




147 



PROGRAM LISTING 



SAMPLE RUN 



1 DIMNl<6,6>,KlU8>*Al<16)*X<2>,Y<2> 

3 DATA 3,102,103,120,130*121,112,111,12 

4 DATA 21,30,1020,1030,1011,1021,1003,1002,1012 
10 F0RM*lT0l8tREADKKM)«NEXTM 

13 DATA- I, 0,1, 0,0,-1, 0,1,- 1*- 1*1** 1>-1, \»\* I 

14 F0R01«lT016jREADAK01>iNEtfT0t 
20 GOTO 500 

50 F0RJ»1T05 

51 FORK»lT05 

55 IFNKJ,K)>99THEN6OSUB200 

60 NEXTK 

65 NEXTJ 

90 LETK»0*LETM2*0»LETM3=0 

99 FORJ«0TO6» PRINT 

100 FORK*0fO6 

101 IFJO0THENIFJO6THEN105 

102 IFK»6ThENPRINT0; * GOTO 125 

103 PRINTK* tGOTO120 

105 IFK«>0THENIFK<>6THEN110 

106 IFJ*6ThENPRIMT0j GOTO 126 

107 PRINTJ* tGOTO120 
110 GOSUB300 

120 NEXTK 

125 NEXTJ 

126 RETURN 

200 LETB*ltIFNKJ,K»999THENLETB»10 
220 F0R01*1T015STEP2 

230 LETnKJ+A1(01),K+A1<01 + 1 > >«N1 < J+Al <0 1 ),K+AU01 + 1 ))+B 

231 NEXT01 
239 RETURN 

300 IFN1<J,KX3THEN399 

305 F0R01*1T018 

310 IFN1(J,K)=»KKO1)THEN350 

315 NEXTOl 

320 GO TO 399 

350 IFO1>9THEN360 

351 LETNKJ,K>*100:LETM2*M2+1»PRINT" * "J 
355 RETURN 

360 LETNKJ,K>«»1000tLETM3*M3+ltPRlNT" # "; 

365 RETURN 

399 LETNKJ,K>*0*PRINT" ";tRETURN 

500 PRlNTTAB<10)j"U.B LIFE GAME" 

505 LETM2»0»LETM3*0 

510 F0RJ*1T05 

511 FORK*1T05 

515 LETN1<J>K>»0 

516 NEXTK 

517 NEXTJ 

519 FORB«1TO2jLETP1»3*IFB*2THENLETP1»30 

520 PRINT"PLAYER'*;B;"3 LIVE PIECES" 
535 FORK1»1TO3:GOSUB700 

540 LETNKX<B),Y<B))*PlsNEXTKl 
542 NEXTB 

559 6OSUB90 

560 PRINTtGOSUB50 

570 IFM2*0THENIFM3*0THEN574 

571 lFM3s»0THBNLETB»l»GOTO575 

572 lFM2*0THENLETB»2sGOTO575 

573 GOTO580 

574 PRlNTtPRINT"A DRAW*':RUN 

575 PRINTiPRINT M PLAYER M ;B;"IS THE VlNNER"tRUN 

580 FORB«lT02»PRiNTtPRlNT ,, PLAYER";Bl tGOSUB700 

581 IFBa99THEN560 

582 NEXTB 

586 LETNl<X(l),Y<l)>«100tLETNl<X<2),Y<2))»i000 

596 GOTO 560 

700 PRINT"X,Y M :PRINT"XXXX";CHR$C 13); "••§•"; CHRS<1 3) »INPUTY<B),X(B> 

705 IFX<B)<«5THENIFX<B)»0THEN708 

706 GOTO750 

708 IFY<B><*5THENIFY<B»0THEN715 

710 GOTO750 

715 IFN1(X<B),Y<B)X>0THEN750 

720 iFBal THEN RETURN 

725 IFX<l>*X<2)THENiFY<l>«Y<2)THEN740 

730 RETURN 

740 PRINT"SAME COORD. SET TO 0" 

741 LETN1(X<B)+1,Y<B)*1 >»0*LETB«99i RETURN 
750 PR INT" ILLEGAL COORDS* RETYPE'* t GO T07 00 
900 END 



U.B LIFE GAME 
PLAYER 1 3 LIVE PIECES 
X,Y 

X,Y 

urn 

X,Y 

un 

PLAYER 2 3 LIVE PIECES 
X,Y 

nn 

X,Y 

mi 

X,Y 



1 


2 


3 


4 


5 





2 * 


* 








2 


3 


4c 




# 




3 


4 






# 




4 


5 










5 


1 


2 


3 


4 


5 





PLAYER 


1 


X,Y 








PLAYER 


2 


X,Y 









2 * * ♦ 

3 * # 

4 # # 
5 

12 3 4 
PLAYER 1 X,Y 


# 
5 


2 
3 
4 
5 



PLAYER 2 X,Y 







1 # 




* 




1 


2 




* 




2 


3 * 








# 3 


4 


* 


# 


# 


4 


5 






# 


5 


1 
PLAYER 


2 
1 


3 
X,Y 


4 


5 


mi 










PLAYER 


2 


X,Y 







PLAYER 1 X,Y 



PLAYER 2 X,Y 



2 




2 


3 


* 


3 


4 


* 


* 4 


5 


# 


* 5 


1 


2 3 4 


5 


PLAYER 


1 X>Y 





PLAYER 2 X,Y 

n» 

SAME COORD. SET TO 



PLAYER 1 IS THE WINNER 



14« 



SAMPLE RUN 



This sample run shows the method of play. 

Normally the co-ordinates typed in will he 

over the other characters, so that the opposing 

player can not see where the pieces are placed, 

U.B LIFE GAME 
PLAYER 1 3 LIVE PIECES 
X,Y 
71,1 
X*Y 
71,2 
X,Y 
7 1 , 3 

PLAYER 2 3 LIVE PIECES 
X,Y 
75,5 
X,Y 
75,4 
X,Y 
75,3 



PLAYER 2 


X,Y 








75, 3\3\2 










1 2 
I 


3 


4 

* 


5 

* 




1 


2 


* 






2 


3 # # 








3 


4 


# 


# 


# 


4 


5 








5 


0.1 2 


3 


4 


5 





PLAYER 1 


X,Y 








74,4 










ILLEGAL COORDS. 


RETYPE 


X,Y 










74, 3 










PLAYER 2 


X,Y 








75,3 











The board is printed in its initial state. 



1 2 3 4 5 
PLAYER 1 X,Y 
73,3 

PLAYER 2 X,Y 

75,6 

ILLEGAL COORDS. RETYPE 

X,Y 

75,3 



12 3 4 5 

1 1 
2*2 

3 * * #3 

4 # # 4 

5 5 
I 2 3 4 5 

PLAYER 1 X,Y 
?3,2 

PLAYER 2 X* Y 
72,4 



12 3 4 5 

1 1 

2 * * * 2 

3 * #3 

4 # # # 4 

5 5 
12 3 4 5 

PLAYER 1 X,Y 
71,5 

PLAYER 2 X,Y 

71,3 

ILLEGAL COORDS. RETYPE 

X,Y 

71,2 



After the first generation. 



The co-ordinates typed in are 
out of range. 



1 


2 


3 4 


5 





PLAYER 


1 


X,Y 






71,2 










PLAYER 


2 


X,Y 






73,1 










1 
1 


2 


3 4 

# * 


5 



1 


2 * 








2 


3 








3 


4 


# 


# 


# 


4 


5 




# # 




5 


1 


2 


3 4 


5 





PLAYER 


1 


X,Y 






71,1 










PLAYER 


2 


X,Y 






72,2 










1 


2 


3 4 


5 





1 * 




# 




1 


2 * 


# 


# 




2 


3 # 




# 




3 


4 


# 


# 




4 


5 


# 


# # 




5 


1 


2 


3 4 


5 





PLAYER 


1 


X,Y 






?l,5 










PLAYER 


2 


X,Y 






71,4 











The co-ordinates typed in 
are of a current live element. 



2 * # # 




2 


3 # 




3 


4 




4 


5 * # 




5 


1 2 3 4 


5 





PLAYER 1 X,Y 






71,3 






PLAYER 2 X,Y 






71,3 






SAME COORD. SET 


TO 






1 2 3 4 5 

1 * * 1 

2 # * * * 2 

3 * # 3 

4 * # # # 4 

5 5 
12 3 4 5 

PLAYER 1 X,Y 
73,5 



PLAYER 2 |S THE WINNER 



PLAYER 2 X,Y 

73,5 

SAME COORD, SET TO 



1 2 3 4 5 

1 * * 1 

2 # * 2 

3 # 3 

4 * # # # 4 

5 5 
12 3 4 5 

PLAYER 1 X,Y 

74,4 

ILLEGAL COORDS. RETYPE 

X,Y 

74,3 



Both players have entered 

the same co-ordinates. No live 

pieces are placed on the board. 



149 



LITQZ 



CHILDREN'S LITERATURE QUIZ 



Description 



This is a simple CA I -type program which presents four mult iple- 
choice questions from children's literature. Running the program 
is self-explanatory. 

Source 

Pamela McGinley 
Harcourt-Brace-Jovanavich 
New York, NY 

LIT GZ EDUSVSTEM 30 

5 R = 

19 PRINT "TEST YOUR KNOWLEDGE ■ OF ' CHILDREN" S LITERATURE. " 

12 PRINTSPRINT "THIS IS A MULTIPLE-CHOICE QUIZ. " 

13 PRINT "TYPE ft 1, 2, 3, OR 4 ftFTER THE QUESTION MARK. " 
15 PRINTSPRINT "GOOD LUCK ! ! " SPR I NTSPR I NT 
46 PRINT "IN "PINOCCHIO", WHftT WAS THE NAME OF THE CAT?" 

42 PRINT "DTIGGER, 2)CICER0, 3)FIGftR0, 4) GUI PETTO"; 

43 INPUT ASIF fl = 3 THEN 46 

44 PRINT "SORRY, . . FIGARO WAS HIS NAME. "SGOTO 50 
46 PRINT "VERY GOOD! HERE-- S ANOTHER." 
4? R = R + 1 
59 PRINTSPRINT 

51 PR I NT" FROM WHOSE GARDEN DID BUGS BUNNY STEAL THE CARROTS?" 

52 PRINT "DMR. NIXON'S, 2>ELMER FUDD'S, 3) CLEM JUDD'S, 4 )STR0MB0L I" S" > 
INPUT ASIF A=2 THEN 56 

PRINT "TOO BAD... IT WAS ELMER FUDD'S GARDEN. "SGOTO 60 
PRINT "PRETTY GOOD! " 



53 
54 
56 
5? R=R+1 

60 PRINTSPRINT 

61 PRINT "IN THE WIZARD OF OZ, 
"DCICERO, 2>TRIXIE, 
ASIF A=4 THEN 66 
"BACK TO THE BOOKS. . . 



DOROTHY'S DOG WAS NAMED" 
3)KING, 4)T0T0".; 



TOTO WAS HIS NAME. "SGOTO 70 



"YEA! YOU'RE A REAL LITERATURE GIANT!" 



62 PRINT 

63 INPUT 

64 PRINT 
66 PRINT 
6? R=R+1 

70 PRINTSPRINT 

71 PRINT "WHO WAS THE FAIR MAIDEN WHO ATE THE POISON APPLE?" 
"D SLEEPING BEAUTY, 2) CINDERELLA, 3) SNOW WHITE, 4) WENDY" 
ASIF A=3 THEN 76 

. . IT WAS SNOW WHITE. "SGOTO 80 



"OH, COME ON NOW. 
"GOOD MEMORY! " 



72 PRINT 

73 INPUT 

74 PRINT 
76 PRINT 
7? R=R+1 
30 PRINTSPRINT 

35 IF R=4 THEN 100 

90 IF R<2 THEN 200 

92 PRINT "NOT BAD, BUT YOU MIGHT SPEND A LITTLE MORE TIME" 

94 PRINT "READING THE NURSERY GREATS. " 

96 STOP 

100 PRINT 

105 PRINT 

110 PRINT 

120 PRINT 

130 STOP 

200 PRINT 

205 PRINT 

999 END 

READY 



"WOWJ THAT'S SUPER! YOU REALLY KNOW YOUR NURSERY" 
"STORIES. "SPRINT 

"YOUR NEXT QUIZ WILL BE ON 2ND CENTURY CHINESE" 
"LITERATURE (HA, HA, Hft>" 



"UGH. THAT WAS DEFINITELY NOT TOO SWIFT. 
'NURSERY SCHOOL FOR YOU, MY FRIEND. " 



BACK TO" 




D.AM 



LIT GZ EDUSYSTEM 30 

TEST YOUR KNOWLEDGE OF CHILDREN'S LITERATURE. 



THIS 
TYPE 



IS A MULTIPLE-CHOICE QUIZ. 

A 1, 2, 3, OR 4 AFTER THE QUESTION MARK. 



IN 'PINOCCHIO', WHAT WAS THE NAME OF THE CAT> 
DTIGGER, 2>CICER0, 3)FIGAR0, 4 >GUIPETT0?3 
VERY GOOD! HERE'S ANOTHER. 



FROM WHOSE GARDEN DID BUGS BUNNY STEAL THE CARROTS"' 

DMR. NIXON" S, 2) ELMER FUDD'S, 3) CLEM JUDD'S, 4>STR0MBriLI' S?2 

PRETTY GOOD! 



IN THE WIZARD OF OZ, DOROTHY'S DOG WAS NAMED 
DCICERO, 2>TRIXIE, 3)KING, 4)T0T0?4 
YEA! YOU" RE A REAL LITERATURE GIANT! * 



WHO WAS THE FAIR MAIDEN WHO ATE THE POISON APPLE-' 
DSLEEPING BEAUTY, 2)CINDERELLA, 3>SN0W WHITE, 4>WENDY- | 2 
OH, COME ON NOW. . . IT WAS SNOW WHITE. 



NOT BAD, BUT YOU MIGHT SPEND A- L I TTLE MORE TIME 
READING THE NURSERY GREATS. 



150 



MATH 1)1 



PICTORIAL ADDITION PRACTICE 



Description 



The program presents pictorial drill on addition facts uping 
printed dice with no reading involved. It is good for beginning 
addition, since the answer can be derived from counting spots 
on the dice as well as by memorizing math facts or awareness of 
number concepts. It is especially effective run on an alpha- 
numeric CRT terminal. 

Program Author 

Jim Gerrish 

Bern ice A. Ray School 

Hanover, NH 03755 




Illustration by Virginia Nigut, 
Scott, Foresman and Co. 



151 



PROGRAM LISTING 

MflTHD EDUSYSTEM 30 

16 REM-MATHDICE*** (BASIC PROGRAM BEGINS AT LINE ISO) WAS PROGRAMMED 

11 REM-BY JIM GERRISH, FOURTH GRADE TEACHER AT THE BERN ICE A. RAY 

12 REM-5CH00L, HANOVER, NEW HAMPSHIRE. LAST CHANGE: 5/21/72. 

13 REM 

14 REM-PROGRAM PERFORMS PICTORAL DRILL ON ADDITION FACTS USING 

15 REM-PRINTED DICE, NO READING INVOLVED. GOOD FOR BEGINNING 

16 REM-ADDITION, SINCE ANSWER CAN BE DEPRIVED FROM COUNTING SPOTS 

17 REM-DICE AS WELL AS BY MEMORISING MATH FACTS OR AWARENESS 

18 REM-OF NUMBER CONCEPTS. 

19 REM- 

20 PRINT"THIS PROGRAM GENERATES SUCCESSIVE PICTURES OF TWO DICE. " 

21 PRINT"WHEN TWO DICE AND AN EQUAL SIGN FOLLOWED BY A QUESTION" 

22 PR I NT "MARK HAVE BEEN PRINTED, TYPE YOUR ANSWER AND THE RETURN KEY. 

23 PRINT"T0 CONCLUDE THE LESSON, TYPE CTRL/C AS YOUR ANSWER, " 

24 PRINT 

25 PRINT 

198 RANDOMIZE 
105 LET N = N + 1 
110 LET D=INT<RND<0>*6+1> 

120 PRINT ". . " 

139 IF D-l THEN 200 

149 IF D = 2 THEN ISO 

150 IF D = 3 THEN 180 
160 PRINT "I * * I" 
170 GOTO 210 

ISO PRINT "I * I" 

190 GOTO 210 

200 PRINT "I I" 

218 IF D*2 THEN 260 

220 IF D = 4 THEN 260 

230 IF D=6 THEN 270 

240 PRINT "I * I" 

250 GOTO 280 

260 PRINT "I I" 

265 GOTO 280 

270 PRINT "I * * I" 

280 IF D*l THEN 350 

298 IF D=2 THEN 330 

300 IF D=3 THEN 330 

310 PRINT "1**1" 

320 GOTO 360 

330 PRINT "I * I" 

340 GOTO 360 

350 PRINT M I" 

360 PRINT ", . " 

370 PRINT 

375 IF N=2 THEN 50O 

380 PRINT " +" 

381 PRINT 
400 LET fl=D 
410 GOTO 100 
580 LET T=D+A 

510 PRINT " a ".i 

520 INPUT Tl 

530 IF T1=T THEN 590 

540 PRINT "NO, COUNT THE SPOTS 

541 PRINT " = ".; 
550 INPUT T2 
560 IF T2=T THEN 590 
570 PRINT "NO, THE ANSWER IS •; 
580 GOTO 600 
590 PRINT "RIGHT!" 
600 PRINT 

661 PRINT "THE DICE ROLL AGAIN. 

610 PRINT 

615 LET N=0 

620 GOTO 100 

900 END 

READY 



AND GIVE ANOTHER ANSWER. 



SAMPLE RUN 

MATHD EDUSYSTEM 30 

THIS PROGRAM GENERATES SUCCESSIVE PICTURES OF TWO DICE. 
WHEN TWO DICE AND AN EQUAL SIGN FOLLOWED BY A QUESTION 
MARK HAVE BEEN PRINTED, TYPE YOUR ANSWER AND THE RETURN KEY. 
TO CONCLUDE THE LESSON, TYPE CTRL/C AS YOUR ANSWER. 



I * I 
I I 
I * I 









?3 




RIGHT 








THE 


DICE 


ROLL 


AGAIN 


I * 
I 


* 


I 
I 






I * 


* 


I 







I * I 
I I 

1*1 



NO, COUNT THE SPOTS AND GIVE ANOTHER ANSWER. 

= ?5 
NO, THE ANSWER IS 6 

THE DICE ROLL AGAIN 



1**1 
I * I 
I * * I 



I * * I 
I I 
1**1 



RIGHT! 

THE DICE ROLL AGAIN. 



I * I 
I I 
I * I 



I I 
I * I 
3 T 



RIGHT! 

THE DICE ROLL AGAIN. 



I * * I 
I * I 
3 * * I 



I * I 
I I 

I * I 



152 



MNOPLY 



GAME OF MONOPOLY 



Description 



MNOPLY is a simulation of the most popular board game in the 
world, Monopoly. It varies from the actual game only in that 
two players are the maximum number that can play. 

The dialog during the game presents complete rules and instruc- 
tions. The inputs are designed so that when anything except the 
required input is typed in, the entire segment will be ignored. 
When questions are asked about property to be sold, the full 
name is required— e.g. , STATES AVENUE. 

In the computer game, you always pay $50 to get out of jail 
unless you have a "GET OUT OF JAIL FREE" card. No double rolls. 

As in the board game, before you can improve your property 
(build houses), you must own all of the pieces of that color 
property--!. e. , have a monopoly of a particular color group. 
The program will automatically ignore attempts to build houses 

if you don't have a color group monopoly. Here are the color 
groups for your reference: 



Purple: 

BALTIC AVE 

MEDITERRANEAN AVE 
Light Blue: 

ORIENTAL AVE 

VERMONT AVE 

CONNECTICUT AVE 
Maroon: 

ST. CHARLES PL 

STATES AVE 

VIRGINIA AVE 
Orange: 

ST. JAMES PL 

TENNESSEE AVE 

NEW YORK AVE 



Red: 

KENTUCKY AVE 

INDIANA AVE 

ILLINOIS AVE 
Yellow: 

ATLANTIC AVE 

VENTNOR AVE 

MARVIN GARDENS 
Green: 

PACIFIC AVE 

NORTH CAROLINA AVE 

PENNSYLVANIA AVE 
Dark Blue: 

PARK PL 

BOARDWALK 



Computer Limitations 

MNOPLY was written for DIGITAL RSTS-11 or RSTS/E. It requires 
two virtual memory files which are built via the file-building 
program. 

Source 



David Barker 

Southeastern State College 

Durant, OK 74701 




153 



PROGRAM LISTING 



1 I THE POLLONXNG PROGRAM 13 DESIGNED TO BUILD THE DISK FILES 
9 I NEEDED TO PLAY MONOPOLY, TWO FILES MUST BE BUILT, THE FIRST 

3 I CONTAINING THE NAMES OF THE PROPERTY* THE SOLD AND UNSOLD 

4 I FLAGS, THE PRICES OF THE PROPERTY, AND THEIR RENTS, 

5 I THE SECOND FILE CONTAINS THE CHANCE AND THE COMMUNITY 

6 I CHEST MESSAGES AND THE INSTRUCTION MESSAGES FOR THE 

7 I PLAYERS. THE DATA FOR THESE FILES WILL BE READ FROM THE 

8 | PROGRAM WHEN IT IS RUN, THESE FILES MUST BE BUILT BEFORE THE 

9 | GAME CAN BE PLAYED 

20 OPEN "PRPRTY" AS FILE II DIM #1,QS(40X)i25,LX(40) ,p(40X) ,R(40X> 

30 OPEN "MESAJ" AS FILE 3| DIM #3,CS(10)i90X,Z$(10)«90X,M$C20)*60X 

40 FOR HI TO 40 

42 READ G$(X),LXCX),PCI),RU) 

44 NEXT I 

90 FOR !■! TO 20 

52 READ HSU) 

84 NEXT I 

80 FOR 1*1 TO 10 

82 READ CSCI) 

84 NEXT I 

70 FOR 1*1 TO 10 

72 READ ZSCX) 

74 NEXT I 

100 DATA "MEDITERRANEAN AVENUE", 0,60, 2 

102 DATA "COMMUNITY CHEST*, 0,0,0 

104 DATA "BALTIC AVENUE", 0,80, 4 

108 DATA "INCOME TAX", 0,0,0 

108 DATA "READING RAILROAD", 0,200, 29 

110 DATA "ORIENTAL AVENUE", 0,100,8 

112 DATA "CHANCE ?», 0,0,0 

114 DATA "VERMONT AVENUE", 0,100, 8 

116 DATA "CONNECTICUT AVENUE",0, 120,8 

118 DATA "VISITING IN JAXL", 0,0,0 

120 DATA "ST. CHARLES PLACE", 0,140,1' 

122 OATA "ELECTRIC COMPANY", 0, 150, 3 & 

124 DATA "STATES AVENUE", 0, 140, 10 

126 DATA "VIRGINIA AVENUE", 0, 160, 12 

128 DATA "PENNSYLVANIA RAILROAD«,0,200, 26 

130 DATA "ST, JAMES PLACE", 0, 180, 14 

132 DATA "COMMUNITY CHEST", 0,0,0 

134 DATA "TENNESSEE AVENUE", 0, 180, 14 

136 DATA "NEW YORK AVENUE", 0,200, 16 

138 DATA "FREE PARKING", 0,0,0 

140 DATA "KENTUCKY AVENUE", 0,220, 16 

142 DATA "CHANCE ?», 0,0,0 

144 DATA "INDIANA AVENUE", 0,220, 16 

146 DATA "ILLINOIS AVENUE" ,0,240,20 

148 DATA "B,& 0, RAILROAD", 0,200, 25 

150 DATA "ATLANTIC AVENUE", 0,260, 22 

152 DATA "VENTNOR AVENUE", 0,260, 22 

164 DATA "WATER WORKS", 0, 190,38 

186 DATA "MARVIN GARDENS", 0,260, 24 

158 DATA "GO TO JAIL", 0,0,0 

160 DATA "PACIFIC AVENUE", 0,300, 26 

162 DATA "NORTH CAROLINA AVENUE", 0,300, 26 

164 DATA "COMMUNITY CHEST", 0,0,0 

166 DATA "PENNSYLVANIA AVENUE" ,0,320,28 

168 DATA "SHORT LINE", 0,200, 25 

170 DATA "CHANCE ?«, 0,0,0 

172 DATA "PARK PLACE", 0,350, 35 

174 DATA "LUXURY TAX", 0,0,0 

176 DATA "BOARDWALK", 0,400, 50 

178 DATA "GO", 0,0,0 

200 DATA "*********#***THI8 IS MATLIDAIS MONOPOLY FOR TWO********** 

202 DATA "EACH PLAYER HAS S1800" 

204 DATA "WHEN YOU BUY HOUSES YOU HAVE TO PUT THE SAME" 

206 DATA "NUMBER ON EACH MEMBER OF A COLOR GROUP" 

208 DATA "WHEN YOU BUY MOUSES INPUT THE NUMBER YOU WANT PER LOT" 

210 DATA "TO ROLL DICE TYPE ROLL" 

212 DATA "IT IS FOR SALE FOR ONLY" 

214 DATA "IF YOU WISH TO BUY IT TYPE BUY" 

216 DATA "YOU ROLLED DOUB|.ES**RQLL AGAIN" 

218 DATA "YOU ROLLED 3 SETS OF DOUBLE8**G0 TO JAIL" 

220 DATA "IF YOU WANT TO QUIT TYPE QUIT" 

222 DATA "YOU ALREADY OWN THIS PIECE OF PROPERTY" 

224 DATA "IF THERE IS ANY PROPERTY YOU WISH TO SELL AND" 

226 DATA "YOUR OPPONENT WANTS TO BUY TYPE SELL" 

228 DATA "IF YOU NEED A LIST OF PROPERTY TYPE LIST" 

230 DATA "YOU CAN'T SELL THIS**YOU DON'T OWN IT" 

232 DATA "WHAT PROPERTY 00 YOU WANT TO SELL" 

234 DATA "IF THERE IS ANY MORE PROPERTY YOU WISH TO SELL TYPE YES" 

236 DATA "IF YOU WANT TO IMPROVE YOUR PROPERTY TYPE HOUSE" 

238 DATA "YOU DON'T HAVE ENOUGH MONEY FOR THAT MANY HOUSES" 

250 DATA "PAY POOR TAX OF $15" 

252 DATA "ADVANCE TOKEN TO ILLINOIS AVENUE" 

254 DATA "GO BACK THREE SPACE8" 

256 DATA "ADVANCE TO GO" 

258 DATA "BANK PAYS YOU DIVIDEND OF $50" 

260 DATA "TAKE A RIDE ON THE READING" 

262 DATA "GO TO JAIL" 

264 DATA "BUILDING AND LOAN MATURE8**C0LLECT $150" 

266 DATA "ADVANCE TO BOARDWALK" 

268 DATA "ADVANCE TO ST, CHARLES PLACE" 

280 DATA "XMA8 FUND MATURES**COLLECT $100" 

282 DATA "LIFE INSURANCE MATURE$**COLLECT 8100" 

284 DATA "INCOME TAX REFUND**COLLECT $20" 

286 DATA "DOCTOR'S FEE**PAY $50" 

268 DATA "YOU INHERIT $100" 

290 DATA "ADVANCE TO GO" 

292 DATA "PAY HOSPITAL $100" 

294 DATA "GO TO JAIL" 

296 DATA "PAY SCHOOL TAX OF $50" 

298 DATA "BANK ERROR IN YOUR FAVOR**COLLECT $200" 

300 CLOSE 1,31 END 



1 I MONOPOLY GAME BY DAVID BARKER, SOUTHEASTERN STATE COLLEGE, DURANT, OK 
8 | SLIGHT PROGRAM MODIFICATIONS BY DAVID AHL, DIGITAL 
3 MCl),MC2>«t500%l I(1),IC2M*0| DIM AS(25) ,BS(25) ,H%(40) 

7 OPEN "PRPRTY" AS FILE ll DIM *i ,G$(40%>«2S,LX (40) ,P<40X),R(40X) 

8 FOR X«i TO 39iLXCI),HXCI)»0lNEXT XlFOR 1*1 TO 8iU(I)t0|NEXT I 

9 DEF PNR»(HX(I(Z))*RCX(Z))*10X) 

10 OPEN "ME8AJ" AS FILE 3f DIM #3,CS(10)i50X,ZS(10)»80X,MS(20>i50X 
15 ft MS(1)|&|&|& "*#RULES**«U M$(2)|6 M$(3)lft MS(4)ll M$(S) 

30 INPUT»WHO IS PLAYER «1")N$<1)| INPUT"WHO IS PLAYER M">N$(2> 

100 PRXNTl PRINT "**«N$(l)"»S TURN**********" | Fi0 

102 Z'lXl G08UB 10001 G09UB 2000 

115 IF D«D1 THEN P»F*ll XF F<3 THEN PRINT M$(9>| GOTO 102 

117 IF Fi3 THEN PRINT M$M0)| I(Z)*10I MU)*M(Z)-50X 

200 PRINTl PRINT "**"N$(2)»»S TURN**********" I F*0 

202 Zt2XI GOSUB 10001 GOSUB 2000 

215 IF DiDl THEN PiP*H IF. F*3 THEN PRINT MSC9) I GOTO 202 

217 XF Fi3 THEN PRINT M$(10)l I(Z1#10I M(|)tM(Z)-80X 

225 PRINT M$(ti)»llNPUT P$l IF P$»"QUIT" THEN 30000 ELSE 100 

1000 PRINT M$(6)MINPUT F$| RANDOMXZEl XiRNDC0)l Y«RNDC03 IDXCE ROLL 

1002 IF XM0 AND X<", 16 THEN Oil 

1003 XFX», 16 AND X«*,32 THEN D*2 

1004 IF X>,32 AND X«*,48 THEN DO 
1006 IF X»,48 AND X«*,64 THEN DM 

1006 IF X»,64 AND X«*,81 THEN 0*8 

1007 IF X»,81 AND X«*l THEN 0*6 

1009 IF YM0 AND Yo.16 THEN Dlil 

1010 IF Y>,t6 AND Y<i,32 THEN DH2 

1011 IF Y»,3t AND Y««,48 THEN Dl*3 

1012 IF Y»,48 AND Y«i,64 THEN DIM 

1013 IF Y»,64 AND Y<t,81 THEN Dt*5 

1014 IF Y»,8t AND Y«*t THEN Dlt6 

1015 PRINT "YOU ROLLED A»D"ANDA«DilI(Z)iI(Z)*(D*Dl) 

1016 IF I(Z)M0X THEN I (Z)*I (Z>»40XlM(Z)*M(Z)*200X 

1017 RETURN 

2000 PRINT"YOU ARE ON "|G$(ICZ)) JPLACEMENT 

2002 IF I(Z)i2 OR I(Z)*l7 OR I(Z)»33 THEN 4100 ICOM CHEST 

2004 IF KZ)*4 THEN MCZ)*M(Z)»200% IRETURN {INC TAX 

2006 IF I(Z)*7 OR ICZ)"22 OR I(Z)"36 THEN 4400 JCHANCE 

2008 IF I(Z)»10 OR ICZ>*20 THEN RETURN IVI8IT IN JAIL&PREE PARKING 

2010 IF I(Z)*30 THEN M(Z)»M(Z)»S0XI I(Z)"10I RETURN 1JAIL 

2011 IF KZ)*38 THEN M(Z)"M(Z)«75X| RETURN ILUX TAX 

2012 IF I(Z)»40 THEN M(Z)«M(Z)*200Xl I(Z)*0l RETURN 1G0 

2018 IF LXCKZniZ THEN PRINT M$(12)| GOTO 3100 

2019 IP CHX(ICZ))»0 AND LX(XCZ))»0 AND LXCI(Z))OZ) THEN 2128 

2020 IF (HXCICZn>0 AND LX(I(Z)>*0 AND LX(I(Z))«»Z) THEN 2100 
2022 PRINT M$(7)|P(ICZni"D0LLAR9" 

2024 PRINT M$(8)|IINPUT F$l IF F$«»«BUY« THEN 3100 
2026M(Z)»M(Z)-P(I(ZJ)IPRXNT "YOU NOW HAVE"M(Z) "DOLLARS 
2027 LX(X(Z))iZlGOTO 3100 

2100 IF Z*l THEN M(Z)*M(Z)*FNR| M(2) *M(2)*FNR 

2101 PRINT "YOU OWE"FNR"DOLLARS RENT»|RETURN 

2102 IF Z*2 THEN M(Z)»M(Z)*FNR| M(l)*M(l)+FNR 

2103 PRINT "YOU OWE»FNR"DOLLARS RENT"|RETURN 

2125 IF Z*l THEN M(Z)»M(Z)"RCI CZ) ) lMe2)*M<2)*R(I CZ) ) 

2126 PRINT "YOU OWE"R(I(Z) ) "DOLLARS RENT«lRETURN 

2127 IF Z»2 THEN M<Z)»M(Z)-RU CZ)) I M( t)nMCt)*RCI(Z) 5 

2128 PRINT "YOU OWE"R(I(Z)) "DOLLARS RENT"|RETURN 

3100 PRINT M$(13)l PRINT MS(14)MXNPUT P$l IF FSi"SELL" THEN GOSUB 3150 

3105 PRINT M$(19)MINPUT MSI IF H$»«HOUSE" THEN 3200 ELSE RETURN 

3150 PRINT M$(15)IIINPUT F$l IF F$«"LI8T" THEN GOSUB 3170 

3*52 PRINT MSU75MINPUT V$l INPUT "HOW MUCH DO YOU WANT FOR IT"IV 

3154 FOR 1*1 TO 39 

3156 IF V$*G$CI) THEN IF LX(I)*0 THEN PRINT M$(16)I RETURN 

3158 IF V$*G$CI) THEN XF LXM)*1 THEN M(l)iM(H*V 

|MC2)*MC2)«VI LX(X)*2l GOTO 3168 
3160 IF V$*G$(I) THEN IF LX(I)l2 THEN M(2)iM(2)*V 

lM(i)iM(i)-Vl LX(I)"tl GOTO 3165 
3162 NEXT I 

3165 PRINT M$(18)HINPUT F$l IF F$i"YES" THEN 3152 ELSE RETURN 
3170 C,D*0t FOR 1*1 TO 39 
3172 IP LXCI)»t THEN CiC*ll A$eC)«G$(I) 

3174 IF LX(I)*2 THEN D*D*1I B$(0)«G$(I) 

3175 NEXT I 

3176 PRINT N$<t)"'S PROPERTY"! FOR 1*1 TO Cl PRINT A$CI)I NEXT I 

3178 PRINT N$(2)"'S PROPERTY"! FOR 1*1 TO Dl PRINT B$U)l NEXT IlRETURN 

3200 IF LX(1)*Z AND LX(3)»Z THEN &«HOW MANY HOUSES AT $50 EACH DO YOU WANT ON" 
IPRINT G$(t)" »G$€3)MINPUT UIGOSUB 3250 

3202 IF LX(6)*Z AND LX(8)*Z AND LX(9)*Z THEN 

PRINT "HOW MANY HOUSES AT $50 EACH DO YOU WANT ON" 
IPRINT G$C6)» "G$(8J" »G$(9 J 1 1 INPUT UlGOSUB 3252 

3204 IF LXCil)"Z AND LX(13)*Z AND LX(t4)"Z THEN 

PRINT "HOW MANY HOUSES AT $100 EACH DO YOOU WANT ON" 
IPRINT G$C1D" "G$(13)» "G$(14)MINPUT UlGOSUB 3254 

3206 IF LXC16)*Z AND LX(18)*Z ANO LX(19)"Z THEN 

PRINT "HOW MANY HOUSES AT $100 EACH DO YOU WANT ON" 
IPRINT G$a6)« «G$(18)» "G$(19» Fl INPUT UlGOSUB 3256 

3208 IF LXC21)"Z AND LX(23)»Z AND LX(24)«Z THEN 

PRINT "HOW MANY HOUSES AT $150 EACH DO YOU WANT ON" 
IPRINT G$(2l)» »G$(23)»"G$(24)MINPUT UlGOSUB 3258 

3210 IF LXt26)*Z AND LX<27)«Z AND LX(29y*Z THEN 

PRINT "HOW MANY HOUSES AT $150 EACH DO YOU WANT ON" 
IPRINT G$(26)" «G$C27)» "G$(29)|l INPUT UlGOSUB 3260 

3212 IF LX(3i)*Z AND LX(32)"Z AND LX(34)*Z THEN 

PRINT "HOW MANY HOUSES AT $200 EACH DO YOU WANT ON" 
IPRINT GSC3D" "G$(32)" »G$(34)MINPUT UlGOSUB 3262 

3214 IF LX(37>*Z AND LX(39)*Z THEN 

PRINT "HOW MANY HOUSES AT $200 EACH DO YOU WANT ON" 
IPRINT G$<37>" "G$(39)|lINPUT UIGO.SUB 3264 

3220 RETURN 

3250 U(1)*U(1)*UI M(Z)"M(Z)"(U*100XJI IF MCZS<0 THEN PRINT M$(20) 

lMCZ>*M(Z)*CU*100X)lU(t>iUm*UlRETURN 

3251 HX(l),HXC3)«U(l)l RETURN 

3252 U(2)"U(2)*UI MCZ)«M(Z)-(U*150X) I IF MeZ)<0 THEN PRINT M$(20) 

|M(Z)*M(Z>*(U*150X)I Ue2)*U(2>«Ul RETURN 

3253 HX€6),HX(8),HX(9)»UC2)I RETURN 

3254 U(3)*U(3)*UI MCZ)*M(Z)-(U*150X) I IF MCZX0 THEN PRINT M$(20) 

IM(Z)*M(Z)*CU*150X)I U(3)*U(3)»UI RETURN 

3255 HXCU),HX(l3),HXC14>»UC3)l RETURN 

3256 UC4)*U(4)*UI M(Z)*M(Z)-CU*300X) I IF M(Z)<0 THEN PRINT M$C20) 

|M(Z)*M(Z)*(U*300X)I U(4)bU(4)«UI RETURN 

3257 HX(16),HX(16),HXC19)*U(4)l RETURN 

3258 U(6)«U(5)*UI M(Z)"M(Z)*(U*450X) I IF MCZX0 THEN PRINT M$(20) 

|M(Z)"M(Z)*CU*450X)I U(5)»U(5)"UI RETURN 

3259 HXC21),HX(23),HXC24)"U(5)| RETURN 



154 



3860 U(6)nU(6)*Ul M(Z>iMCZWU*450X>l IF M(Z)<0 THEN PRINT M8<20> 
1MCZ)»H(Z)*(U*450X)I U(6>«U(6)-UI RETURN 

3261 HXC26),HX(27),HXC29)«U<6)I RETURN 

3262 U(7)»U<7)*Ul M(Z)"MCZ)»(U#600X)I IP MCZX0 THEN PRINT MS(20) 

lM(Z)tM(Z>*(U*606X)l U(7)iU<7>»Ul RETURN 

3263 HXC31),HXC32>,HX<34>»U(7)l RETURN 

3264 U(8)tU(8)*Ul M<Z)«M(Z)«(U*400X) I IP M(Z)«0 THEN PRINT M8(20) 

lM(Z)iHCZ>+<U*400X)l U<8)«U(8)-Ul RETURN 
3266 HX(37),HXC39)»UC8)I RETURN 
4100 RANDOHIZEl L«RND(0) iCOMMUNITY CHEST 

4102 IF L»i0 AND U«t,t THEN PRINT ZtCUl HCZ)iH(Z>*100Xl RETURN 
4104 IP L».l AND L«*,2 THEN PRINT ZS(2)I M(Z) *M<Z}*100Xl RETURN 
4106 IP L>,2 AND l«n,3 THEN PRINT ZS<3)| M(Z)»M(Z)*20Xl RETURN 
4108 IF L»,3 AND LO.4 THEN PRINT Zl(4)l M(Z)iM(Z)*80Xl RETURN 
4110 IF L*,4 AND U«i,5 THEN PRINT ZSCS)l M(Z)«H(Z)*100Xt RETURN 
4112 IF U.S AND U«i,6 THEN PRINT Z$(6)l M(Z)*H<Z>*200Xf XCZ)«8l RETURN 
4114 IP ti.riND L«*.7 THiH-pfriNrzifTTi MtZ)»MTZ>-i00Xr RfTORN 
4116 IF t»,7 AND '(.<■,• THgN PRINT ZS(8)I HM)tM<Z>«S0Xl I(Z)*I0I RETURN 
4118 IF U>.8 AND L<»,9 THEN PRINT ZS(9)I HCZ)«M(Z>»60X| RETURN 
4120 IP L»,9 AND L««l THEN PRINT ZS(10)I MCZ)«M(Z)*200Xl RETURN 
4400 RANDOHIZEl t«RND(0) JCHANCE 

4402 IF U>«0 AND l<n,l THEN PRINT CS(1)| H(Z>§M(Z>*$SXl RETURN 
4404 IF U*,l AND L<i»2 THEN PRINT C$(2)l I<Z)i24| 608UB 20001 RETURN 
4406 IF L>,2 AND U<«,3 THEN PRINT C$(3)l I(Z)«I(Z)«3| 60SUB 20001 RETURN 
4408 IF L*,3 AND I.4I.4 THEN PRINT C*(4)| JCZMBl H(Z)*H<Z)*200X| RETURN 
4410 IF L>,4 AND L<*,5 THEN PRINT C$(S)| M(Z)»M(Z) ♦50X1 .RETURN 
4412 IF L>,8 AND L<«,6 THEN PRINT CS(6)l HZ)«S 

lMCZ)iM(Z>*200Xl GOSUB 20001 RETURN 
4414 IF U>,6 AND L«i,7 THEN PRINT Ci(7) I I (Z)*10| M(Z)tM(Z)»50Xl RETURN 
4416 If U.7 AND L«*,8 THEN PRINT CSC8JI HCZ)«H(Z)*180Xl RETURN 
4418 IF L».8 AND L«n,9 THEN PRINT C$(9)l 1tf)«39| 003U8 20001 RETURN 
4420 IF L*.9 AND L«»l THEN PRINT CSU0M XCZ)»lll GOSUB 20001 RETURN 
30000 C,D*0 
30002 FOR III TO 39 

30004 IF LX(I)"1 THEN C«C*liA8(C)«GS(I) 
30006 IF UX(I)*2 THEN D*D*1|BS.(D>>0SCI) 

30008 NEXT IlPRINTlPRINT 

30009 PRINT NS(1)« OWNED THE FOLLOWING PROPERTY" 

ifOR IM TO ClPRlNT AS(I)|NEXT I 

30010 PRINT "AND HAD"I M( 1 ) > "DOLLARS AT THE END OF THE GAME" 

30011 PRINT NS(2)« OWNED THE FOLLOWING PROPERTY" 

IFOR I«l TO DlPRlNT BSCDtNEXT I 

30012 PRINT "AND HAD" I M(2) I "DOLLARS AT THE END OF THE GAME" 

30013 CLOSE 1,3|END 



•+-+DAVE'' S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 5 AND A 4 

VOU ARE ON GO TO JAIL 

*# SANC'V S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED ft 6 AND ft 1 

VOU ftRE ON NEW VORK ftVENUE 

IT IS FOR SALE FOR ONLV 200 DOLLftRS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HAVE 1206 DOLLARS 

IF THERE IS ftNV PROF'ERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

IF VOU WANT TO QUIT TVPE QUIT? 

**DAVE y S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 5 AND A 4 

VOU ARE ON NEW VORK AVENUE 

VOU OWE 16 DOLLARS RENT 

**SftNDV'S .TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 6 AND A 4 , 

VOU ARE ON MARVIN GARDENS 

IT IS FOR SALE FOR ONLV 288 DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HAVE 926 DOLLARS 

IF THERE IS ANV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

IF VOU WANT TO QUIT TVPE QUIT? 

**DAVE'S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 4 AND A 5 

VOU ARE ON WATER WORKS 

IT IS FOR SALE FOR ONLV 150 DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? 

IF THERE IS ANV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

**SANDV'S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 6 AND A 1 

VOU ARE ON CHANCE ? 

ADVANCE TOKEN TO ILLINOIS AVENUE 

VOU ARE ON ILLINOIS AVENUE 

VOU OWE 20 DOLLARS RENT 

IF VOU WANT TO QUIT TVPE QUIT? 



SAMPLE RUN 



RUN MONPLV 

:*************THIS IS MATLIDA'S MONOPOLV FOR TWO* 



**RULES** 

EACH PLftVER HAS *1500 

WHEN VOU BUV HOUSES VOU HAVE TO PUT THE SAME 

NUMBER ON EACH MEMBER OF A COLOR GROUP 

WHEN VOU BUV HOUSES INPUT THE NUMBER VOU WANT PER LOT 

WHO IS PLftVER #1? DftVE 

WHO IS PLftVER #2? SftNDV 

* * D ft V E ' S T U R N * * * * * * * * * * 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED ft 6 AND ft 1 

VOU ARE ON CHANCE ? 

ADVANCE TOKEN TO ILLINOIS AVENUE 

VOU ftRE ON ILLINOIS ft VENUE 

IT IS FOR SOLE FOR ONLV 240 DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HftVE 1260 DOLLftRS 

IF THERE IS ftNV PROPERTV VOU WISH TO SELL ftND 

VOUR OPPONENT WftNTS TO BUV TVPE SELL? 

IF VOU WftNT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

**SftNDV - ' S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED ft 2 AND A 4 

VOU ARE ON ORIENTAL AVENUE 

IT IS FOR SftLE FOR ONLV 100 DOLLftRS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HftVE 1400 DOLLftRS 

IF THERE IS ftNV PROPERTV VOU WISH TO SELL ftND 

VOUR OPPONENT WftNTS TO BUV, TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

IF VOU WANT TO QUIT TVPE QUIT? 

**DAVE''S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 3 AND A 3 

VOU ARE ON GO TO JAIL 

VOU ROLLED DOUBLES**ROLL AGAIN 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 6 AND A 5 - 

VOU ARE ON KENTUCKV ftVENUE 

IT IS FOR SftLE FOR ONLV 220 DOLLftRS ? 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HftVE 990 DOLLftRS 

IF THERE IS ftNV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF. VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 



**SANDV-' S TURN* 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED ft 1 AND ft 5 

VOU ftRE ON ELECTRIC COMPftNV 

IT IS FOR SftLE FOR ONLV 150 DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? 

IF THERE IS ftNV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

IF VOU WANT TO QUIT TVPE QUIT? 



155 



* * D A V E '' S T U R N * * * * * * * * * * 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 2 AND A 6 

VOU ARE ON PARK PLACE 

IT IS FOR SALE FOR ONLV 350 DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HAVE 574 DOLLftRS 

IF THERE IS ftNV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

* * S A N D V ' S T U R N * * * * * * * * * * 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 6 AND A 2 

VOU ARE ON NORTH CAROLINA AVENUE 

IT IS FOR SALE FOR ONLV 3&& DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HAVE 626 DOLLARS 

IF THERE IS ANV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

IF VOU WANT TO QUIT TVPE QUIT? 

* * D ft V E ' S TURN**** * * * * * * . 
TO ROLL DICE TVPE ROLL? ROLL 
VOU ROLLED ft 5 AND ft 1 

VOU ftRE ON BALTIC AVENUE 

IT IS FOR SALE FOR ONLV 6© DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? 

IF THERE IS ANV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

**SANDV" S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 1 AND A 6 

VOU ARE ON BOARDWALK 

IT IS FOR SALE FOR ONLV 400 DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HAVE 236 DOLLARS 

IF THERE IS ANV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

IF VOU WANT TO QUIT TVPE QUIT? 

**DAVE' S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 2 AND A 5 

VOU ARE ON VISITING IN JAIL 

**SANDV '~S TURN********** 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 6 AND A 6 

VOU ARE ON ST. CHARLES PLACE 

IT IS FOR SALE FOR ONLV 140 DOLLARS 

IF VOU WISH TO BUV IT TVPE BUV? BUV 

VOU NOW HAVE 296 DOLLARS 

IF THERE IS ANV PROPERTV VOU WISH TO SELL AND 

VOUR OPPONENT WANTS TO BUV TVPE SELL? 

IF VOU WANT TO IMPROVE VOUR PROPERTV TVPE HOUSE? 

VOU ROLLED DOUBLES**ROLL AGAIN 

TO ROLL DICE TVPE ROLL? ROLL 

VOU ROLLED A 5 AND A 5 

VOU ARE ON KENTUCKV AVENUE 

VOU OWE 18 DOLLARS RENT 



MUGWMP 



FIND 4 MUGWUMPS IN HIDING 



Description 



Your objective in this game is to find the four Mugwumps hiding 
on various squares of a 10 by 10 grid. Homebase (lower left) is 
position (0,0) and a guess is a pair of whole numbers (0 to 9), 
separated by commas. The first number is the number of units 
to the right of homebase and the second number is the distance 
above homebase. 

You get ten guesses to locate the four Mugwumps ; after each guess , 
the computer tells you how close you are to each Mugwump. Play- 
ing the game with the aid of graph paper and a compass should 
allow you to find all the Mugwumps in six or seven moves using 
triangulation — i.e., like LORAN radio navigation. 

Source 

This program was modified slightly by Bob Albrecht of People's 
Computer Company. The original source were students of: 

Bud Valenti 
Project SOLO 

University of Pittsburgh 
Pittsburgh, PA 15213 




ftC/GWuMf \ 



156 



PROGRAM LISTING 



SAMPLE RUN 



1 REM COURTESV OF PEOPLE'S COMPUTER COMPANV 

2 REM MUQWMP 

Z< REM *** CONVERTED TO RSTS/E BV DAVID AHL, DIGITAL 

5 RANDOMISE 

18 DIM P<4, 2> 

28 PRINT "THE OBJECT Of THIS GAME IS TO FIND FOUR MUGWUMPS" 

38 PRINT "HIDDEN ON A 18 BV 18 GRID. HOMEBASE IS POSITION 0,8" 

40 PRINT "ANV GUESS VOU MAKE MUST BE TWO NUMBERS WITH EACH" 

50 PRINT "NUMBER BETWEEN AND 9/ INCLUSIVE. FIRST NUMBER" 

60 PRINT "IS DISTANCE TO RIGHT OF HOMEBASE AND SECOND NUMBER" 

70 PRINT "IS DISTANCE ABOVE HOMEBASE. " 

80 PRINT 

90 PRINT "VOU GET 10 TRIES. AFTER EACH TRV, I WILL TELL" 

100 PRINT "VOU HOW FAR VOU ARE FROM EACH MUGWUMP. " 

110 PRINT 

240 GOSUB 1008 

250 T=8 

260 T = T+1 

278 PRINT 

275 PRINT 

290 PRINT "TURN NO. "T; "WHAT IS VOUR GUESS"; 

300 INPUT M, N 

318 FOR 1=1 TO 4 

220 IF P<I,1>=-1 THEN 488 

330 IF P<I,l>OM THEN 388 

348 IF P<I/2>ON THEN 388 

350 PU,1> = -1 

368 PRINT "VOU HAVE FOUND MUGWUMP" ; I 

378 GOTO 400 

388 D=Si3R < < P (. 1 , 1 > -M > -2+ < P < 1 , 2 > -N > ~2 > 

398 PRINT "VOU ARE"INTCD+10>/18"UNITS FROM MUGWUMP"! 

480 NEXT I 

41*3 FOR J=l TO 4 

420 IF P(J, DO-1 THEN 470 

430 NEXT J 

440 PRINT 

458 PRINT "VOU GOT THEM ALL IN"; T; "TURNS ! " 

468 GOTO 588 

478 IF T<18 THEN 268 

488 PRINT 

498 PRINT "SORRV, THAT' S 18 TRIES. HERE IS WHERE THE V' RE HIDING" 

548 FOR 1=1 TO 4 

558 IF P(I,1>=-1 THEN 578 

568 PR INT " MUGWUMP " ; I ; " I S AT C " ;P(L1 > ; " .• " ; P <.' I > 2 > ; " > " 

570 NEXT I 

588 PRINT 

600 PRINT "THAT WAS FUN! LET'S PLAV AGAIN " 

610 PRINT "FOUR MORE MUGMUMPS ARE NOW IN HIDING. " 

628 GOTO 240 

1000 FOR J=l TO 2 

1818 FOR 1=1 TO 4 

1028 P<I, J> = INT<10*RND<0>;' 

1030 NEXT I 

1848 NEXT J 

1858 RETURN 

1099 END 

READV 



THE OBJECT OF THIS GAME IS TO FIND FOUR MUGWUMPS 
HIDDEN ON A 18 BV 18 GRID. HOMEBASE IS POSITION 8,8 
ANV GUESS VOU MAKE MUST BE TWO NUMBERS WITH EACH 
NUMBER BETWEEN 8 AND 9, INCLUSIVE. FIRST NUMBER 
IS DISTANCE TO RIGHT OF HOMEBASE AND SECOND NUMBER 
IS DISTANCE ABOVE HOMEBASE. 

VOU GET 18 TRIES. AFTER EACH TRV, I WILL TELL 
'*'OU HOW FAR VOU ARE FROM EACH MUGWUMP. 



TURN NO. 1 WHAT IS VOUR GUESS? 5,5 

VOU ARE 6. 4 UNITS FROM MUGWUMP 1 

VOU ARE 1. 4 UNITS FROM MUGWUMP 2 

VOU ARE 2. 2 UNITS FROM MUGWUMP 3 

VOU ARE 1. 4 UNITS FROM MUGWUMP 4 



TURN NO. 2 WHAT IS VOUR GUESS? 4, 
VOU ARE 5 UNITS FROM MUGWUMP 1 
VOU ARE 2 UNITS FROM MUGWUMP 2 
VOU ARE 1 UNITS FROM MUGWUMP 2 
VOU ARE 2. 8 UNITS FROM MUGWUMP 4 



TURN NO. 2 WHAT IS VOUR GUESS? 6, 6 
VOU ARE 7. 8 UNITS FROM MUGWUMP 1 
VOU ARE 2 UNITS FROM MUGWUMP 2 
VOU ARE -3. 6 UNITS FROM MUGWUMP 2 
VOU HftVE FOUND MUGWUMP 4 



TURN NO. 4 WHAT IS VOUR GUESS? 4, 

VOU ARE 6. 7 UNITS FROM MUGWUMP 1 
VOU HftVE FOUND MUGWUMP 2 

VOU ARE 2.2 UNITS FROM MUGWUMP 3 



TURN NO. 5 WHAT IS VOUR GUESS? 
VOU ARE 4.4 UNITS FROM MUGWUMP 
VOU HftVE FOUND MUGWUMP 2 



TURN NO. 6 WHAT IS VOUR GUESS? 1, « 
VOU HftVE FOUND MUGWUMP 1 



VOU GOT THEM ALL IN 6 TURNS! 



THAT WAS FUN! LET'S PLAV AGAIN..... 
FOUR MORE MUGMUMPS ARE NOW IN HIDING. 



TURN NO. 1 WHAT IS VOUR GUESS? 4, 
VOU ARE 2.8 UNITS FROM MUGWUMP 1 
VOU ARE 4. 4 UNITS FROM MUGWUMP 2 
VOU ARE 5. 2 UNITS FROM MUGWUMP 3 
VOU ARE 5 UNITS FROM MUGWUMP 4 



TURN NO. 2 WHAT IS VOUR GUESS? 2, 
VOU ARE 5. 6 UNITS FROM MUGWUMP 1 
VOU ARE 2 UNITS FROM MUGWUMP 2 
VOU ARE 7 UNITS FROM MUGWUMP 3 
VOU ARE 7; 2 UNITS FROM MUGWUMP 4 



TURN NO. 2 WHAT IS VOUR GUESS? 6, 
VOU HftVE FOUND MUGWUMP 1 
VOU ARE 7. 2 UNITS FROM MUGWUMP 2 
VOU ARE 5 UNITS FROM MUGWUMP 3 
VOU ARE 2.6 UNITS FROM MUGWUMP 4 



TURN NO. 4 WHAT IS VOUR GUESS? 8,2 
VOU HftVE FOUND MUGWUMP 2 
VOU ARE 9 UNITS FROM MUGWUMP 3 
VOU ARE 8 UNITS FROM MUGWUMP 4 



TURN NO. 5 WHAT IS VOUR GUESS? 4,9 
VOU ARE 8. 6 UNITS FROM MUGWUMP 3 
VOU HftVE FOUND MUGWUMP 4 



TURN NO. 6 WHftT IS VOUR GUESS? 9, 2 
VOU HAVE FOUND MUGWUMP 2 



VOU GOT THEM ALL IN 6 TURNS! 



157 



NICOMA 



COMPUTER GUESSES YOUR NUMBER 



Description 

One of the most ancient forms of arithmetical puzzle is sometimes 
referred to as a "boomerang . " At some time, everyone has been 
asked to "think of a number # " and, after going through some 
process of private calculation, to state the result, after which 
the questioner promptly tells you the number you originally 
thought of. There are hundreds of varieties of the puzzle. 

The oldest recorded example appears to be that given in Arithmetica 
of Nicomachus, who died about the year 120. He tells you to 
think of any whole number between 1 and 100 and divide it suc- 
cessively by 3, 5, and 7 , telling him the remainder in each case. 
On receiving this information, he promptly discloses the number 
you thought of. 

Can you discover a simple method of mentally performing this feat? 
If not, you can see how the ancient mathematician did it by look- 
ing at Lines 80-100 of the program. 

Program Author 

Digital Equipment Corp. 
Maynard, MA 01754 




158 



PROGRAM LISTING 

18 PRINT "BOOMERANG PUZZLE FROM ARITHMETICS OF NICOMACHUS — 
28 PRINT 

39 PRINT "PLEASE THINK OF A NUMBER BETWEEN 1 AND 108. " 

40 PRINT "VOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF"; 
45 INPUT A 

50 PRINT "VOUR NUMBER DIVIDED BY 5 HAS A REMAINDER OF"; 

55 INPUT B 

60 PRINT "VOUR NUMBER DIVIDED BY ? HAS A REMAINDER OF"; 

65 INPUT C - 

?6 PRINT 

80 PRINT "LET ME THINK A MOMENT...." 

90 SLEEP< 5 :^ 

100 D=70*fl+21*B+15*C 

110 IF D<=1@5 THEN 140 

120 D=D-185 

130 GOTO 110 

140 PRINT 

150 PRINT "VOUR NUMBER WAS"D", RIGHT"; 

160 INPUT A* 

165 PRINT 

170 IF A*="YES" THEN 220 

180 IF A*="NO" THEN 249 

190 PRINT "EH? I DON'T UNDERSTAND "'A*'" TRY 'YES'' OR ' NO' 

200 GOTO 158 

220 PRINT "HOW ABOUT THAT ! i " 

230 GOTO 250 

240 PRINT "I FEAR VOUR ARITHMETIC IS IN ERROR. " 

250 PRINT 

268 PRINT "LET'S TRY ANOTHER. " 

270 GOTO 20 

999 END 



SAMPLE RUN 

BOOMERANG PUZZLE FROM ARITHMETICA OF NICOMACHUS — A. D. 90! 

PLEASE THINK OF A NUMBER BETWEEN 1 AND 100. 

VOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF ?3 

VOUR NUMBER DIVIDED BY 5 HAS A REMAINDER OF ?0 

VOUR NUMBER DIVIDED BY 7 HAS A REMAINDER OF ?5 

LET ME THINK A MOMENT.... 

VOUR NUMBER WAS 75 , RIGHT ?RIGHT 

EH? I DON'T UNDERSTAND 'RIGHT'. TRV 'YES' OR ' NO' 
VOUR NUMBER WAS 75 , RIGHT ?VES 

HOW ABOUT THAT! ! 

LET'S TRV ANOTHER. 

PLEASE THINK OF A NUMBER BETWEEN 1 AND 100. 

VOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF ?2 

VOUR NUMBER DIVIDED BV 5 HAS A REMAINDER OF ?4 

VOUR NUMBER DIVIDED BV 7 HAS A REMAINDER OF ?6 

LET ME THINK A MOMENT. ... 

VOUR NUMBER WAS 104 , RIGHT ?YES 

HOW ABOUT THAT ! ! 

r ■ - 
LET'S TRY ANOTHER. 

PLEASE THINK OF A NUMBER BETWEEN 1 AND 100. 

VOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF ?1 

VOUR NUMBER DIVIDED BV 5 HAS A REMAINDER OF ?1 

VOUR NUMBER DIVIDED BV 7 HAS A REMAINDER OF ?1 

LET ME THINK A MOMENT. ... 

VOUR NUMBER WAS 1 , RIGHT ?NO 

I FEAR VOUR ARITHMETIC IS IN ERROR. 

LET'S TRV ANOTHER. 

PLEASE THINK OF A NUMBER BETWEEN 1 AND 100. 

VOUR NUMBER DIVIDED BV 3 HAS A REMAINDER OF ?0 

VOUR NUMBER DIVIDED BV 5 HAS A REMAINDER OF ?0 

VOUR NUMBER DIVIDED BV 7 HAS A REMAINDER OF ?1 

LET ME THINK A MOMENT. . . . 

VOUR NUMBER WAS 15 , RIGHT ?VES 

HOW ABOUT THAT ! ! 



159 



NIM 



CHINESE GAME OF NIM 

Description 

NIM is one of the oldest two-person games known to man; it is 
believed to have originated in ancient China. The name, which 
was coined by the first mathematician to analyze it, comes from 
an archaic English verb which means to steal or to take away. 
Objects are arranged in rows between the two opponents as in 
the following example: 

X X X X X X X Row 1 — 7 Objects 

X X X X X Row 2 — 5 Objects 

XXX Row 3 — 3 Objects 

X Row 4 — 1 Object 

Opponents take turns removing objects until there are none 
left. The one who picks up the last object wins. The moves 
are made according to the following two rules: 

1. On any given turn only objects from one row may be 
removed. There is no restriction on which row or on 
how many objects you remove. Of course, you cannot 
remove more than are in the row. 

2. You cannot skip a move or remove zero objects. 

The winning strategy can be mathematically defined, however, 
rather than presenting it here, we'd rather let you find it 
on your own. HINT: Play a few games with the computer and 
mark down on a piece of paper the number of objects in each 
stack (in binaryl) after each move. Do you see a pattern 
emerging? 

Source 

One of the most popular computer games. Over 10 versions of 
NIM were submitted. One notable one came from Larry Ruane, 
Mt. Prospect, Illinois, who programmed NIM for a DIGITAL 
EduSystem 10. Quite a featl The one published is from: 

Robert G. Cox 
Trinity College 
Hartford, CT 06106 



160 



PROGRAM LISTING 

100 REM THIS PROGRAM U3E8 A STRATEGY AS PRESENTED IN 'GAMES OF FUN AND 

105 REM STRATEGY", A PUBLICATION OF THE MATHEMATICAL SERVICES DEPART- 

110 REM MENT OF COMPUTER CONTROL CO., INC. 

115 PRINT "THIS PROGRAM pLAYS NIM." 

120 PRINT "Do YOU WANT INSTRUCTIONS" »\INPUT QS 

125 IF Q$«»YE8" THEN 135\lF Q$«»NO" THEN 190 

130 PRINT "TYPE YES OR NO."\INPUT QSVGQTO 126 

135 PRINT 

140 print " nzm is played by two people playing alternately, before" 
145 print "the play starts, an arbitrary number of sticks or objects is" 
150 print "put into an arbitrary number of piles, in any distribution" 
155 print "whatever, then each player in his turn removes as many" 
160 print "sticks as he wishes from any pile—but from only one pile," 
105 print "and at least one stick, the player who takes the last stick" 
170 print "is the winner." 
175 print « this Program allows you to set up the initial arrangement" 

180 pRlN T »oF PILES AND STlCKs. It WILL N T ACCEPT M RE THAN TWENTY" 
185 PRINT "PILES OR STICKS IN EACH pILE," 
190 RANDOM 

195 REM— -• — — — -CONFIGURATION INPUT — — — ——— 

200 DIM X(20,4),S(20),L(20),S2(20),N2(4),cC20), 83(20), V(20) 

205 PRINTNPRINT "HOW MANY PILES" jWNPUT P\IF P>20 THEN 215 

210 IF P>INTCP) THEN 215UF P<-0 THEN 215VG0 TO 220 

215 PRINT "ILLEGAL PILE NUMBER. "\PRINT\GO TO 205 

220 PRINTSFOR Z*l TO P 

225 PRINT "HOW MANY STICKS IN PILE»| I?\INPUT L(I)\1F L(I)>20 THEN 235 

230 IF L(I)>INT(L(I)) THEN 235\IF L(I)<«0 THEN 235\G0 TO 240 

235 PRINT "ILLEGAL STICK NijMB£R,«\PRINtNGO T Q 225 

240 NEXT I 

245 FOR !■! TO PVS(I)«L(I)\G«G*LCI)\NEXT I 

250 PRlNTVpRlNT "Do YOU want to so first"; 

255 INPUT 0$\iF QS""YES" ThEN 340VlF Q$««NO« ThEn 390 

260 PRINT "TYPE Y£S OR N0."\G0 TO 255 

265 REM — CONTROL OF GAME REPEATS AND TESTS FOR END OF GAME- — 

270 IF G»0 THEN 2 75MF F«i THEN 390\GO TO 32® 

275 IF F«i THEN 3l 5 

280 PRINt\PRINt "I WON. DO YOu WANt tO p UY AGAIN«j 

285 INPUT Q$MF Q$««N0" THEN 290\IF q$««YEs m tHEN 300\GO tO 295 

290 STOP 

2g5 PRINT "TYPE YES OR NO."\GO TO 2s5 

300 PRINTVPRINT "SAME ARRANGEMENT" \ 

305 INPUT Q$\IF Q$««NO» THEN tf^WT Q$b«YE3« THEN 345 

310 PRINT "TYPE YES OR N0."\G0 TO 305 

3i5 PRINTNPRINT "YOU WON, DO YOU WANT TO PLAY AGAIN»1\G0 TO 285 

320 PRINTNPRINT «PlLE NUMBER", hSTICKS LEFTn 

325 FOR I«l TO P\IF S(I)«0 THEN 330\P«IMT I,S(I) 

330 NEXT I 

335 rEm- — — —.——pLAYER'S MOVE-— 

340 PRINTVPRINT "WHICH pI L E DQ YOU WAnT STICKS FR0M*»\InPUT n 

345 iF N>P ThEN 355\jF N>lNT(N) ThF-N 355\iF N<«0 ThEN 356 

350 IF S(N)»0 THEN 355\G0 TO 360 

355 PRINT "ILLEGAL PILE NUMBER. "\PRINT\GO TO 340 

360 PRINTNPRINT "HOW MANY STICKS" ; MNPUT T 

365 IF T>S(N) THEN 370UF T>InT(T) THEN 370\IF T<«0 THEN 37#\G0 TO 37S 

370 PRINT "ILLEGAL STICK NUMBER, "\PRINT\G0 TO 360 

375 8(N)«S(N)-T\G«G-T 

380 F«1\G0 TO 270 

385 REM. ............ .MACHINE »s MOyE — - — ............. 

390 FOR I«0 TO 4\v(D B 0\NEXT I 

395 FOR !■! TO P 

400 

405 

410 

415 

420 

425 

430 

435 



SAMPLE RUN 



CCI)»S(I) 

FOR E«4 TO STEP *1 

IF SCI)<2aE THEN 415sS2(I)«S2(I)+10aE\S(I)«S(I)-2aE 
NEXT E 
FOR Y»4 TO STEP -1 

X(I,Y)*INTCS2CI)/10AY)\S2<I)»32(I3.XCI,Y)M0*Y 

V(Y)»V(Y)*X(I,Y) 



NEXT Y 
440 NE X T I 
445 R*0 
450 FOR Y"4 TO STEP 



•1 



455 IF V(Y)/2*INT(VCY)/2)"0 THEN 480 

460 IF R«l THEN 470\Q»InT <P*RnD(X) ) *l 

465 jF X(Q,Y)<>1 THEN 460\X (Q, Y) «0VR»l\GO TO 480 

470 IF X(0,Y)«1 THEN 475\X CQ, Y) »1\G0 TO 480 

475 X(Q,Y)"0 

480 NEXT Y 

485 FOR 1*1 TO P 

490 S2(I)*0 

495 FOR Y«4 TO STEP -1 

500 »3(I)»X(I,Y)*i0AY\S2fI)«82fI)*83(I) 

505 NEXT Y 

510 FOR E«4 TO STEP -1 

515 IF s2(I)<10aE THEN 520\S (I) »8(I )*2aE\s2< I) »S2( I)-10aE 

520 NEXT E 

525 NEXT I 

530 IF R*l THEN 535\Q«INT(P*RNDCX))*l\IF S(Q1«0 THEN 530\8 (0) «S (9) -1 

535 D«C(0)-S(0)VG«G-D 

540 IF D»l THEN 550 

545 PRIN T \PRIN T "I'LL T*KE«|DJ»stICKs FROM PILE" >QJ « ,"\G0 TO 555 

550 PRINTNPKINT "I'LL T*KE 1 STICK FrOM pILE"lQl«,« 

555 F«0\Go TO 270 

560 END 



THIS PROGRAM PLAYS NIM. 

DO YOU WANT INSTRUCTIONS? YES 

NIM IS PLAYED BY TWO PEOPLE PLAYING ALTERNATELY. BEFORE 
THE PLAY STARTS* AN ARBITRARY NUMBER OF STICKS OR OBJECTS IS 
PUT INTO AN ARBITRARY NUMBER OF PILES* IN ANY DISTRIBUTION 
WHATEVER. THEN EACH PLAYER IN HIS TURN REMOVES AS MANY 
STICKS AS HE WISHES FROM ANY PILE--BUT FROM ONLY ONE PILE* 
AND AT LEAST ONE STICK. THE PLAYER WHO TAKES THE LAST STICK 
IS THE WINNER. 

THIS PROGRAM ALLOWS YOU TO SET UP THE INITIAL ARRANGEMENT 
OF PILES AND STICKS. IT WILL NOT ACCEPT MORE THAN TWENTY 
PILES OR STICKS IN EACH PILE. 

HOW MANY PILES? 5 

HOW MANY STICKS IN PILE 1 ? 1 

HOW MANY STICKS IN PILE 2 ? 2 

HOW MANY STICKS IN PILE 3 ? 3 

HOW MANY STICKS IN PILE A ? A 

HOW MANY STICKS IN PILE 5 ? 5 

DO YOU WANT TO GO FIRST? YES 

WHICH PILE DO YOU WANT STICKS FROM? A 

HOW MANY STICKS? 2 

I'LL TAKE 3 STICKS FROM PILE 5 . 

PILE NUMBER STICKS LEFT 

1 1 

2 2 

3 3 

4 2 

5 2 

WHICH PILE DO YOU WANT STICKS FROM? 3 

HOW MANY STICKS? 3 

I'LL TAKE 1 STICK FROM PILE 5 . 

PILE NUMBER STICKS LEFT 

1 1 

2 2 
A 2 
5 1 

WHICH PILE DO YOU WANT STICKS FROM? 5 

HOW MANY STICKS? 1 

I'LL TAKE 1 STICK FROM PILE 1 . 

PILE NUMBER STICKS LEFT 
2 2 

A 2 

WHICH PILE DO YOU WANT STICKS FROM? 4 

HOW MANY STICKS? 1 

I'LL TAKE 1 STICK FROM PILE 2 . 

PILE NUMBER STICKS LEFT 
2 1 

4 1 

WHICH PILE DO YOU WANT STICKS FROM? 5 
ILLEGAL PILE NUMBER. 

WHICH PILE DO YOU WANT STICKS FROM? A 

HOW MANY STICKS? 
ILLEGAL STICK NUMBER. 



HOW MANY STICKS? 1 

I'LL TAKE 1 STICK FROM PILE 2 . 

I WON. DO YOU WANT TO PLAY AGAIN? YES 

SAME ARRANGEMENT? NO 

HOW MANY PILES? 3 

HOW MANY STICKS IN PILE 1 ? 1 
HOW MANY STICKS IN PILE 2 ? 2 
HOW MANY STICKS IN PILE 3 ? 3 

DO YOU WANT TO GO FIRST? NO 

I'LL TAKE 1 STICK FROM PILE 1 . 



PILE NUMBER 
2 



STICKS LEFT 

■' 2 



WHICH PILE DO YOU WANT STICKS FROM? 

HOW MANY STICKS? 1 

I'LL TAKE 1 STICK FROM PILE 3 . 

PILE NUMBER 
2 
3 

WHICH PILE DO YOU WANT STICKS FROM? 

HOW MANY STICKS? 1 

I'LL TAKE 1 STICK FROM PILE 3 . 

STICKS LEFT 



STICKS LEFT 
2 
1 



PILE NUMBER 
2 



1 



161 



WHICH PILE DO YOU WANT STICKS FROM? 2 

HOW MANY STICKS? 1 

YOU WON. DO YOU WANT TO PLAY AGAIN? NO 



NUMBER 



RANDOM NUMBER GAME 



Description 

In contrast to other . number guessing games where you keep guess- 
ing until you get the random number selected by the computer 
(GUESS/ TRAP, STARS, etc.), in this game you get only one guess 
per play and you gain or lose points depending upon how close 
your guess is to the random number selected by the computer. 
You occasionally get a jackpot which will double your point 
count. You win when you get 500 points. 

Program Author 

Tom Adametx 

Curtis Junior High School 

Sudbury, MA 01776 



NUMBER EDUSVSTEM 39 

1 PRINT " NUMBER GAME" 

2 PRINTSPRINT "YOU NOW HAVE 100 POINTS" 

3 PRINT "BY GUESSING NUMBERS FROM 1 TO 5, YOU CRN GAIN OR LOSE 

4 PRINT "POINTS DEPENDING UPON HOW CLOSE YOU GET TO A RANDOM" 

5 PRINT "NUMBER SELECTED BY THE COMPUTER M \PRINT 

6 PRINT "YOU OCCASIONALLY WILL GET A JACKPOT WHICH WILL DOUBLE 

7 PRINT "YOUR POINT COUNT. YOU WIN WHEN YOU GET 500 POINTS " 

8 PRINT\P=100 

11 .PRINT "GUESS A NUMBER FROM 1 TO 5".: 

12 INPUT G 

15 LET R=aNT<5*RND<0>> 

16 LET S=INT<5*RND<0)> 

17 LET T=INT<5*RND<0>> 

18 LET U=INT<5*RND<0>> 

19 LET V=INT<5*RND<0>> 

20 IF G=R THEN 20 

21 IF G*S THEN 40 

22 IF G=T THEN 50 

23 IF G=U THEN 60 

24 IF G=V THEN 70 

25 IF G>5 THEN 11 
38 LET P=P-5 
35 GO TO 80 
40 LET P=P+5 
45 GO TO 80 
50 LET P=P+P 

52 PRINT "YOU HIT THE JACKPOT" 
55 GO TO 80 
68 LET P=P + 1 
65 GO TO 80 
70 LET P=P-<P*. 5) 
80 IF P>500 THEN 90 
82 PRINT "YOU HAVE "; Pi "POINTS" 
35 GO TO 11 

90 PRINT " ! ! ! ! YOU WIN! ! ! i WITH ".; P.; "POINTS" 
99 END 



READY 




NUMBER GAME 

YOU NOW HAVE 199 POINTS 

BY GUESSING NUMBERS FROM 1 TO 5, YOU CAN GAIN op LO'-~E 
POINTS DEPENDING UPON HOW CLOSE YOU GET TO A RANDOM 
NUMBER SELECTED BY THE COMPUTER 

YOU OCCASIONALLY WILL GET A JACKPOT WHI 'CH W I LL DOUBLE < l ) 
YOUR POINT COUNT. YOU WIN WHEN YOU GET 599 POINTS. 

GUESS A NUMBER FROM 1 
YOU HAVE 191 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 196 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 191 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 192 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 9? POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 92 POINTS 
GUESS A NUMBER FROM 1 
YOU HIT THE JACKPOT 
YOU HAVE 184 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 189 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 184 POINTS 
GUESS A NUMBER FROM 1 
YOU HIT THE JACKPOT 
YOU HAVE 268 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 262 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 258 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 262 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 268 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 363 POINTS 
GUESS A NUMBER FROM 1 
YOU HAVE 358 POINTS 
GUESS A NUMBER FROM 1 
YOU HIT THE JACKPOT 
! ! ! !YOU WIN! ! ! ! WITH 

READY 



TO 


5? 3 


TO 


5?3 


TO 


5? 2. 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5? 2 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5?2 


TO 


5? 2 


?!«: 


: POINTS 



162 



1 CHECK 



SOLITAIRE CHECKER GAME 



Description 



In this game or puzzle, 48 checkers are placed on the two 
outside spaces of a standard 64-square checkerboard as shown: 



The object is to remove as many checkers as possible by- 
diagonal jumps (as in standard checkers). 

It is easy to remove 30 to 39 checkers , a challenge to 
remove 40 to 44, and a substantial feat to remove 45 to 47, 

Program Author 

David Ahl 

Digital Equipment Corp. 

Maynard, MA 01754 




163 



PROGRAM LISTING 



1CHECK 95:54 PM 

S PRINT 

10 PRINT 

15 PRINT 

20 PRINT 

25' PRINT 



25-JUN-73 
SOLITAIRE CHECKER PUZZLE BV DAVID AHL" 



"48 CHECKERS ARE PLACED ON THE 2 OUTSIDE SPACES OF A" 
"STANDARD 64-SQUARE CHECKERBOARD. THE OBJECT IS TO" 
30 PRINT "REMOVE AS MflNV CHECKERS AS POSSIBLE BV DIAGONAL JUMPS" 
35 PRINT "<AS IN STANDARD CHECKERS). USE THE NUMBERED BOARD TO" 
46 PRINT "INDICATE THE SQUARE VOU WISH TO JUMP FROM AND TO. ON" 
45 PRINT "THE BOARD PRINTED OUT ON EACH TURN '1' INDICATES A" 
58 PRINT "CHECKER AND <0' AN EMPTV SQUARE. WHEN VOU HAVE NO" 
55 PRINT "POSSIBLE JUMPS REMAINING, INPUT A -0-' IN RESPONSE TO" 
60 PRINT "QUESTION -JUMP FROM ?•'" 
62 PRINT 

65 PRINT "HERE IS THE NUMERICAL BOARD:" 

66 PRINT 

68 DIM A<64) 

78 FOR J = l TO 57 STEP 8 

72 B$="## ## ## ## ## ## ## ##» 

74 PRINT USING B$, J; J + l, J + 2, J + 3, J + 4, J+5, J+6, J+7 

76 NEXT J 

7? PRINT 

78 PRINT "AND HERE IS THE OPENING POSITION OF THE CHECKERS:" 

79 PRINT 

80 FOR J = l TO 64 

82 a-:j> = i 

84 NEXT J 

86 FOR J = 19 TO 43 STEP 8 

88 FOR I=J TO J+3 

.90 AU>=0 

92 NEXT I 

94 NEXT J 

96 M=8 

98 GOTO 340 

100 INPUT "JUMP FROM".; F 

105 IF F=8 THEN 50@ 

1:U3 INPUT "TO".;T 

112 PRINT 

1:18 REM *** CHECK LEGAL I TV OF MOVE 

128 Fl=INT<<F-l>/8) 

130 F2=F-8*F1 

148 Tl=INT<<T-l)/8) 

158 T2=T-8*T1 

160 IF Fl>7 THEN 230 

170 IF Tl>7 THEN 238 

180 IF F2>8 THEN 238 

198 IF T2>8 THEN 238 

288 IF A8S-:F1-T1><>2 THEN 238 

218 IF ABS<F2-T2)<>2 THEN 238 

212 IF A(<T+F)/2>=8 THEN 238 

215 IF A-:F)=8 THEN 238 

228 IF A<T>=1 THEN 238 

225 GOTO 258 

238 PRINT "ILLEGAL MOVE. TRV AGAIN..." 

240 GOTO 188 



UPDATE BOARD 



245 REM 

258 ACT) 

260 A<F>=0 

270 A':-:T + F>/2> = 

290 M = M+1 

310 REM *** PRINT BOARD 

340 FOR J = l TO 57 STEP 8 

350 FOR I* J TO J+7 

360 PRINT A-;n,- 

370 NEXT I 

380 PRINT 

390 NEXT J 

408 PRINT 

410 GOTO 188 

498 REM *** END GAME SUMMARY 

588 S=8 

510 FOR 1=1 TO 64 

520 S=S+A<I> 

530 NEXT I 

535 PRINT 

548 PRINT 

550 PRINT 

560 PRINT 

562 INPUT "TRV AGAIN".; At 

570 IF A$="VES" THEN 70 

575 IF A*="NO" THEN 608 

588 PRINT "PLEASE ANSWER ' YES' OR 

590 GOTO 562 

680 PRINT 

618 PRINT "O.K. HOPE VOU HAD FUN! 

999 END 

READY 



'VOU MADE "M" JUMPS AND HAD" 
'REMAINING ON THE BOARD. " 



SAMPLE RUN 

SOLITAIRE CHECKER PUZZLE BV DAVID AHL 

43 CHECKERS ARE PLACED ON THE 2 OUTSIDE SPACES OF A 
STANDARD 64-SQUARE CHECKERBOARD. THE OBJECT IS TO 
REMOVE AS MANY CHECKERS AS POSSIBLE BV DIAGONAL JUMPS 
<AS IN STANDARD CHECKERS). USE THE NUMBERED BOARD TO 
INDICATE THE SQUARE VOU WISH TO JUMP FROM AND TO. ON 
THE BOARD PRINTED OUT ON EACH TURN '1' INDICATES A 
CHECKER AND '0' AN EMPTY SQUARE. WHEN VOU HAVE NO 
POSSIBLE JUMPS REMAINING, INPUT A '8', IN RESPONSE TO 
QUESTION 'JUMP FROM ?' 

HERE IS THE NUMERICAL BOARD: 



1 


2 


3 


4 


5 


6 


7 


8 


9 


10 


11 


12 


13 


14 


15 


16 


17 


18 


19 


28 


21 


22 


23 


24 


25 


26 


27 


28 


29 


30 


31 


32 


33 


34 


35 


36 


37 


38 


39 


48 


41 


42 


43 


44 


45 


46 


47 


48 


49 


50 


51 


52 


53 


54 


55 


56 


57 


58 


59 


68 


61 


62 


63 


64 



AND HERE IS THE OPENING POSITION OF THE CHECKERS: 



JUMP FROM? 1 
TO? 19 



JUMP FROM? 2 
TO? 20 



JUMP FROM? 3 
TO? 21 



JUMP FROM? 8 
TO? 22 



JUMP' FROM? 16 
TO? 30 



JUMP FROM? 12 
TO? 26 






8 





1 





1 








1 


1 








1 


8 





1 


8 





1 


1 


8 


1 


1 


8 








8 


8 





1 





1 





8 


8 





1 








1 








1 

















JUM 


P FROM 


? 2 


6 








TO? 


44 


















1 


1 


8 





1 





1 











1 


JUMP FROM? 46 


TO? 60 










1 






1 1 

8 



JUMP F 


ROM 


? 2 


9 








TO? 47 














8 


8 








1 


1 


8 


1 











8 


8 











1 





1 


8 


8 


1 











8 


8 


1 


8 





1 





8 


1 


8 








1 





8 


1 


1 


8 


8 





8 





8 


1 





1 


1 








8 


8 


JUMP FROM? 56 








TO? 38 















JUMP FROM? 24 
TO? 38 



JUMP FROM? 48 
TO? 38 



1 1 
8 8 



JUMP FROM? 64 
TO? 46 



JUMP FROM? 30 
TO? 46 



ILLEGAL MOVE. 
JUMP FROM? O 



1 8 
8 8 



TRV AGAIN. 



VOU MADE 35 JUMPS AND HAD 13 PIECES 
REMAINING ON THE BOARD. 



164 



TRV AGAIN? NO 

0. K. HOPE YOU HAD FUN ! 



ORBIT 



DESTROY AN ORBITING ENEMY SPACESHIP 



Description 

ORBIT challenges you to visualize spatial positions in polar 
coordinates • The object is to detonate an explosive within a 
certain distance of a germ laden spaceship. This ship is orbit- 
ing a planet at a constant altitude and orbital rate (degrees/ 
hour) . The location of the ship is hidden by a device that 
renders the ship invisible, but after each bomb you are told 
how close to the enemy ship your bomb exploded. The challenge 
is to hit an invisible moving target with a limited number of 
shots. 

The planet can be replaced by a point at its center (called the 
origin) ; then the ship's position can be given as a distance 
from the origin and an angle between its position and the 
eastern edge of the planet. 



direction 
of orbit 



vr ip 

^s^ wangle 



The distance of the bomb from the ship is computed using the 
law of cosines (see line 430 of the program listing) . The law 
of cosines states 

D 



bomb 



D = V /R**2+D1**2+R*D1*C0S (a-A1) 




ship 



E 



where D is the distance between the ship and the bomb, R is the 
altitude of the ship, Dl is the altitude of the bomb, and A-Al 
is the angle between the ship and the bomb. 

360 



Practice Off -Line Problem: 



Aircraft appear on radar as 
blips of the form "=" . What 
is the distance between the 
TWA and United aircraft shown 
on the radar screen on the right 

Source 

ORBIT was originally called 
SPACE WAR and was written by: 

Jeff Lederer 

Project SOLO 

University of Pittsburgh 

Pittsburgh, PA 15213 




090 



165 



180 



PROGRAM LISTING 



5 RANDOMIZE 

10 PHI NT "SOMEWHERE ABOVE YOUR PLANET IS A ROMULAN SHIP." 

15 PRINT 

20 PRINT "THIS SHlP IS IN A CONSTANT POLAR ORBIT. IT S" 

2 5 PRINT "DISTANCE FROM THE CENTER OF YOUR PLANET IS FROM" 

30 PRINT "10*000 TO 30*000 MILES AND AT IT'S PRESENT VELOCITY CAN" 

31 PRINT "CIRCLE YOUR PLANET ONCE EVERY 12 TO 36 HOURS." 
35 PRINT 

40 PRINT "UNFORTUNATELY THEY ARE USING A CLOAKING DEVICE SO" 
45 PRINT "YOU ARE UNABLE TO SEE THEM, BUT WITH A SPECIAL " 
50 PRINT "INSTRUMENT YOU CAN* TELL HOW NEAR THEIR SHIP YOUR" 

"PHOTON BOMB EXPLODED. YOU HAVE SEVEN HOURS UNTIL THEY" 
"HAVE BUILT UP SUFFICIENT POWER IN ORDER TO ESCAPE " 
"YOUR PLANET'S GRAVITY." 



"YOUR PLANET HAS ENOUGH POWER TO FIRE ONE BOMB AN HOUR." 

"AT THE BEGINNING OF EACH HOUR YOU WILL BE ASKED TO GIVE AN" 
"ANGLE (BETWEEN AND 360) AND A DISTANCE IN UNITS OF" 
"100 MILES (BETWEEN 100 AND 300), AFTERWHICH YOUR BOMB'S" 
"DISTANCE FROM THE ENEMY SHIP WILL BE GIVEN." 

"AN EXPLOSION WITHIN 5*000 MILES OF THE ROMULAN SHIP" 
"WILL DESTROY IT." 



90" 

t" 

0000000000000" 

000000000000000000t> 

000000 000000" 

00000 00000" 

00000 XXXXXXXXXXX 00000" 



"180« 



ooooo 

0000 
0000 
0000 

ooooo 

0000 
0000 
0000 

ooooo 



xxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxx 

xxxxxxxxxxxxx 



0000" 
0000" 
0000" 
0000" 

00000 ==>0" 
0000" 
0000" 
0000" 
00000" 



55 PRINT 
60 PRINT 
65 PRINT 
70 PRINT 
75 PRINT 
80 PRINT 
85 PRINT ' 
90 PRINT ' 
95 PRINT • 
100 PRINT 
105 PRINT 

110 PRINT 

111 PRINT 

114 PRINT 

115 PRINT "BELOW IS A DIAGRAM TO HELP YOU VISUALIZE YOUR PLIGHT 

116 PRINT 

117 PRINT 

168 PRINT 

169 PRINT 

170 PRINT 

171 PRINT 

172 PRINT 

173 PRINT 

174 PRINT 

175 PRINT 

176 PRINT 

177 PRINT 

178 PRINT 

179 PRINT 

180 PRINT 

181 PRINT 

182 PRINT 

183 PRINT 

184 PRINT 

185 PRINT 

186 PRINT 

187 PRINT 

188 PRINT 

189 PRINT 

190 PRINT 

191 PRINT 

192 PRINT 

195 PRINT 

196 PRINT 

197 PRINT 

198 PRINT 

199 PRINT 

200 PRINT 

201 PRINT "AND 

203 PRINT 

204 PRINT "GOOD LUCK. THE FEDERATION IS COUNTING ON YOU." 
270 LET A=INT(RND*360) 

280 LET D=INT(RND*200) +100 

290 LET R*INT(RND*20) +10 

300 LET H=0 

310 IF H=7 GOTO 490 

320 LET H=H+1 

325 PRINT 

326 PRINT 

330 PRINT "HOUR",H,", AT WHAT ANGLE DO YOU WISH TO SEND" 

335 PRINT "YOUR PHOTON BOMB?" 

340 INPUT Al 

350 PRINT "HOW FAR OUT DO YOU WISH TO DETONATE IT?" 

360 INPUT Dl 

365 PRINT 

366 PRINT 
370 LET A»A+R 

380 IF A«360 GOTO 400 

390 LET A-A-360 

400 LET T»ABS<A-A1) 

410 IF T<180 GOTO 430 

420 LET T-360-T 

430 LET C-SQR(D*D*D1*D1-2*D*DI*COS(T*3.I4159/180>> 

440 PRINT "YOUR PHOTON BOMB EXPLODED"JCJ"*l0t2 MILES FROM THE* 

445 PRINT "THE ROMULAN SHIP" 

450 IF C<«50 GOTO 470 

460 GOTO 310 

470 PRINT "YOU HAVE SUCCESSFULLY COMPLETED YOUR MISSION." 

480 GOTO 500 

490 PRINT "YOU HAVE ALLOWED THE ROMULANS TO ESCAPE." 

500 PRINT "ANOTHER ROMULAN SHIP HAS GONE INTO ORBIT." 

510 PRINT "DO YOU WISH TO TRY TO DESTROY IT?" 

520 INPUT CS 

530 IF CS="YES" GOTO 270 

540 PRINT "PLEASE LOGOUT" 

999 END 



00000 XXXXXXXXXXXXX 00000" 

00000 00000" 

000000 000000" 

00000000000000000000" 

000000000000000" 

!" 

270" 



'X - YOUR PLANET" 

- THE ORBIT OF THE ROMULAN SHIP" 

ON THE ABOVE DIAGRAM, THE ROMULAN SHIP IS CIRCLING" 
COUNTERCLOCKWISE AROUND YOUR PLANET. DON'T FORGET" 
WITHOUT SUFFICIENT POWER THE ROMULAN SHIP'S ALTITUDE" 
ORBITAL RATE WILL REMAIN CONSTANT." 



SAMPLE RUN 

SOMEWHERE ABOVE YOUR PLANET IS A ROMULAN SHIP. 

THIS SHIP IS IN A CONSTANT POLAR ORBIT. IT'S 
DISTANCE FROM THE CENTER OF YOUR PLANET IS FROM 
10,000 TO 30,000 MILES AND AT IT S PRESENT VELOCITY CAN 
CIRCLE YOUR PLANET ONCE EVERY 12 TO 36 HOURS. 

UNFORTUNATELY THEY ARE USING A CLOAKING DEVICE SO 
YOU ARE UNABLE TO SEE THEM, BUT WITH A SPECIAL 
INSTRUMENT YOU CAN TELL HOW NEAR THEIR SHIP YOUR 
PHOTON BOMB EXPLODED. YOU HAVE SEVEN HOURS UNTIL THEY 
HAVE BUILT UP SUFFICIENT POWER IN-ORDER TO ESCAPE 
YOUR PLANET'S GRAVITY. 

YOUR PLANET HAS ENOUGH POWER TO FIRE ONE BOMB AN HOUR. 

AT THE BEGINNING OF EACH HOUR YOU WILL BE ASKED TO GIVE AN 
ANGLE (BETWEEN AND 360) AND A DISTANCE IN UNITS OF 
100 MILES (BETWEEN 100 AND 300), AFTERWHICH YOUR BOMB'S 
DISTANCE FROM THE ENEMY SHIP WILL BE GIVEN. 

AN EXPLOSION WITHIN 5,000 MILES OF THE ROMULAN SHIP 
WILL DESTROY IT. 

BELOW IS A DIAGRAM TO HELP YOU VISUALIZE YOUR PLIGHT. 



90 

f 

0000000000000 

0000000000000000000 

000000 000000 

ooooo ooooo 

00000 XXXXXXXXXXX ooooo 



ooooo 

0000 
0000 
0000 

iso<== ooooo 

0000 
0000 
0000 

ooooo 



xxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxx 



0000 
0000 
0000 
0000 

ooooo ==>0 

0000 
0000 
0000 

ooooo 



ooooo xxxxxxxxxxxxx ooooo 
ooooo ooooo 

000000 000000 

00000000000000000000 

000000000000000 

! 

270 



X - YOUR PLANET 

- THE ORBIT OF THE ROMULAN SHIP 

ON THE ABOVE DIAGRAM, THE ROMULAN SHIP IS CIRCLING 
COUNTERCLOCKWISE AROUND YOUR PLANET. DON'T FORGET 
WITHOUT SUFFICIENT POWER THE ROMULAN SHIP'S ALTITUDE 
AND ORBITAL RATE WILL REMAIN CONSTANT. 

GOOD LUCK. THE FEDERATION IS COUNTING ON YOU. 



HOUR 1 , AT WHAT ANGLE DO YOU WISH TO SEND 

YOUR PHOTON BOMB? 

? 

HOW FAR OUT DO YOU WISH TO DETONATE IT? 

? 200 



YOUR PHOTON BOMB EXPLODED 357.237 *10t2 MILES FROM THE 
THE ROMULAN SHIP 



HOUR 2 , AT WHAT ANGLE DO YOU WISH TO SEND 

YOUR PHOTON BOMB? 

? 180 

HOW FAR OUT DO YOU WISH TO DETONATE IT? 

? 200 



YOUR PHOTON BOMB EXPLODED 267.336 *10t2 MILES FROM THE 
THE ROMULAN SHIP 



HOUR 3 , AT WAT ANGLE DO YOU WISH TO SEND 

YOUR PHOTON BOMB? 

? 180 

HOW FAR OUT DO YOU WISH TO DETONATE IT? 

? 200 



YOUR PHOTON BOMB EXPLODED 295.315 *10t2 MILES FROM THE 
THE ROMULAN SHIP 



HOUR 4 , AT WHAT ANGLE DO YOU WISH TO SEND 

YOUR PHOTON BOMB? 

? 250 

HOW, FAR OUT DO YOU WISH TO DETONATE IT? 

? 200 



YOUR PHOTON BOMB EXPLODED 103.558 *10t2 MILES FROM THE 
THE ROMULAN SHIP 



166 



PIZZA 



r 



4 



DELIVER PIZZAS IN HYATTSVILLE 



Description 

In this game, you take orders for pizzas from people living in 
Hyattsville. Armed with a map of the city, you must then tell 
a delivery boy the address where the pizza is to be delivered. 
If the pizza is delivered to the correct address, the customer 
phones you and thanks you; if not, you must give the driver 
the correct address until the pizza gets delivered. 

Some interesting modifications suggest themselves for this 
program such as pizzas getting cold after two incorrect delivery 
attempts or taking three or more orders at a time and figuring 
the shortest delivery route. Send us your modifications! 

Source 

This program seems to have surfaced originally at the University 
of Georgia in Athens, GA. The author is unknown. 



■MMi 



mmcs^mmmmmm 







mmmmmm 





1 964 by E. C. Publications 



167 



PROGRAM LISTING 



SAMPLE RUN 



LISTNH 

10 DIM A*<26>, S*<±6>,N*<4>, fl<±0>, M*<4> 

26 RANDOMIZE 

36 PRINT "PIZZA DELIVERV GAME ".PRINT 

50 INPUT "WHAT IS VOIJR FIRST NAME"; N* : PRINT 

80 PRINT "HI, "N*". IN THIS GAME VOU ARE TO TAKE ORDERS" 

90 PRINT "FOR PIZZAS. THEN VOU ARE TO TELL A DELIVERV 60V" 

100 PRINT "WHERE TO DELIVER THE ORDERED PIZZAS. ": PRINT : PRINT 

140 FOR 1=1 TO 16 

150 READ S*<I> 

160 NEXT I 

170 FOR 1=1 TO 4 

180 READ M*<I> 

190 NEXT I 

200 DATA "A", "B 

220 DATA "1", "2 

220 PRINT 

250 PRINT 

260 K=4 

270 FOR 1=1 TO 4 

280 PRINT "-" .PRINT 

320 PRINT M*<K>; 

330 51=16-4*1+1 



»G", "H", "I" 



MAP OF THE CITV OF HVflTTSVILLE" : PRINT 

i 2— 3— —4 " 



340 PRINT 
350 PRINT 
380 K=K-1 
390 NEXT I 
400 PRINT 
440 PRINT 
460 PRINT 
470 PRINT 
490 PRINT 
500 PRINT 
510 PRINT 
520 INPUT 
530 IF A$="VES 
540 IF fl$="NO" 



"; S*<S1>; ' 
";M*<.K> 



-".PRINT "-": PRINT "-".PRINT "-" 

1 2 3 4 " : PRINT 

THE ABOVE IS A MAP OF THE HOMES WHERE" 
VOU ARE TO SEND -PIZZAS. ": PRINT 
VOUR JOB IS TO GIVE A TRUCK DRIVER" 
THE LOCATION OR COORDINATES OF THE" 
HOME ORDERING THE PIZZA. ".PRINT 
DO VOU NEED MORE DIRECTIONS"; A* 
THEN 590 
THEN 750 



";S*<Sl+3>; 



550 PRINT "'VES' OR 'NO' PLEASE, NOW THEN, ": GOTO 528 
590 PRINT: PRINT "SOMEBODV WILL ASK FOR A PIZZA TO BE" 
600 PRINT "DELIVERED. THEN A DELIVERV BOV WILL" 

"ASK VOU FOR THE LOCATION. ": PRINT " EXAMPLE." 

"THIS IS J. PLEASE SEND A PIZZA. " 

"DRIVER TO "N*". WHERE DOES J LIVE?" 

"VOUR ANSWER WOULD BE 2, 3 ".PR I NT 

"UNDERSTAND"; A* 
THEN 636 
JOB IS TOO DIFFICULT FOR VOU. THANKS ANVWAV. 



610 PRINT 

620 PRINT 

640 PRINT 

650 PRINT 

666 INPUT 

670 IF A*="VES" 

680 PRINT "THIS 



696 PRINT "GOOD. VOU ARE NOW REftDV TO START TAKING ORDERS. ".PRINT 

700 PRINT "GOOD LUCK ! ! " : PRINT 

750 FOR 1=1 TO 5 

760 S=INT<RND+16+1> .PRINT 

770 PRINT "HELLO "N*"'S PIZZA. THIS IS "S*<S>; 

775 PRINT ". PLEASE SEND A PIZZR. " 



WHERE DOES "S*<.S>" LIVE"; 



I DID NOT ORDER A 
A<2> 



780 PRINT " DRIVER TO "N 

790 INPUT A<1>,R<2> 

870 T= A < 1 > + < A < 2 > -1 > *4 

880 IF T=S THEN 928 

SS& PRINT "THIS IS "S*(T>" 

900 PRINT "I LIVE AT "fl<l> 

910 GOTO 780 

920 PRINT "HELLO "N$". THIS IS 

930 NEXT I 

940 PRINT .INPUT "DO VOU WANT TO DELIVER MORE PIZZAS" 

960 IF A$="VES" THEN 750 

970 PRINT:PRINT "O.K. "N*", SEE VOU LATER!" 

999 END 



THANKS FOR THE PIZZA. ' 



RUNNH 

PIZZA DELIVERS GAME 

WHAT IS VOUR FIRST NAME? BETSV 

HI, BETSV. IN THIS GAME VOU ARE TO TAKE ORDERS 
FOR PIZZAS. THEN VOU ARE TO TELL A DELIVERV BOV 
WHERE TO DELIVER THE ORDERED PIZZAS. 



MAP OF THE CITV OF HVATTSVILLE 

± 2 3 4 



4 M N P 4 



3 I J ' K L ■ 3 



2 E F G H 



THE ABOVE IS A MAP OF THE HOMES WHERE 
VOU ARE TO SEND PIZZAS. 

VOUR JOB IS TO GIVE A TRUCK DRIVER 
THE LOCATION OR COORDINATES OF THE 
HOME ORDERING THE PIZZA. 

DO VOU NEED MORE DIRECTIONS? VES 

SOMEBODV WILL ASK FOR A PIZZA TO BE 
DELIVERED. THEN A DELIVERV BOV WILL 
ASK VOU FOR THE LOCATION. 

EXAMPLE: 
THIS IS J. PLEASE SEND A PIZZA. 
DRIVER TO BETSV. WHERE DOES J LIVE? 
VOUR ANSWER WOULD BE 2, 3 

UNDERSTAND? VES 

GOOD. VOU ARE NOW READV TO START TAKING ORDERS. 

GOOD LUCK ! ! 



HELLO BETSV S PIZZA. THIS IS E. PLEASE SEND A 
DRIVER TO BETSV. WHERE DOES E LIVE? 2,1 

THIS IS B. I DID NOT ORDER A PIZZA. 

I LIVE AT "2 , 1 

DRIVER TO BETSV. WHERE DOES E LIVE? 1,2 

HELLO BETSV. THIS IS E, THANKS FOR THE PIZZA. 

HELLO BETSV S PIZZA. THIS IS H. PLEASE SEND A 

DRIVER TO BETSV. WHERE DOES H LIVE? 4,2 
HELLO BETSV. THIS IS H, THANKS FOR THE PIZZA. 

HELLO BETSV S PIZZA. THIS IS P. PLEASE SEND A 

DRIVER TO BETSV. WHERE DOES P LIVE? 4,4 
HELLO BETSV. THIS IS P, THANKS FOR THE PIZZA. 

HELLO BETSV S PIZZA. THIS IS J. PLEASE SEND A 
DRIVER TO BETSV. WHERE DOES J LIVE? 3,2 

THIS IS G. I DID NOT ORDER A PIZZA. 

I LIVE AT 3,2 

DRIVER TO BETSV. WHERE DOES J LIVE? 2,3 

HELLO BETSV. THIS IS J, THANKS FOR THE PIZZA. 

HELLO BETSVS PIZZA. THIS IS C. PLEASE SEND A 

DRIVER TO BETSV. - WHERE DOES C LIVE? 3,1 
HELLO BETSV. THIS IS C, THANKS FOR THE PIZZA. 

DO VOU WANT TO DELIVER MORE PIZZAS? NO 

O.K. BETSV, SEE VOU LATER! 

READV 



168 



POETRY 



RANDOM POETRY (HAIKU) 



Description 



POETRY: This program will randomly choose a singlet, couplet, 
or quatrain from a set of 23 preset PRINT statements. It spaces 
at random intervals, but ends at approximately the same point 
each time. There is a low likelihood of duplication of lines. 

POET: This program produces random verse which might loosely 
be considered in the Japanese Haiku style. It uses 20 phrases 
in four groups of five phrases each generally cycling through 
the groups. It inserts commas (random— -19% of the time), 
indentation (random — 22% of the time) , and starts new para- 
graphs (18% probability, but at least every 20 phrases). 

The version of POET published has phrases suggestive of Edgar 
Allen Poe. Try it with phrases from computer technology, from 
love and romance, from four-year-old children, or from some 
other subject. Send us the output: 

Here are some phrases from nature to try: 



Carpet of ferns 
Morning dew 
Tang of dawn 
Swaying pines 

Entrances me 
Soothing me 
Rustling leaves 
Radiates calm 

Program Author 

POETRY: 

H. David Crockett 
5609 Winibleton Way 
Fort Worth, TX 76133 



Mighty Oaks 
Grace and beauty 
Silently singing 
Nature speaking 

Untouched, unspoiled 
Shades of green 
Tranquility 
. . .so peaceful 



POET: 

Original author unknown. 
Modified and reworked by 
Jim Bailey, Peggy Ewing, and 
Dave Ahl of DIGITAL. 




169 



POETRY 



PROGRAM LISTING 



mrTCffTYE!*" 



THE WORLD" 



TO MURDER DREAMS" 



MAN,' AND HE « 



100 00 TO 116 
110_LET Di0 
T2~"0 UET DiO*l 
130 00 TO 1300 

140 PRINT "THE HOURS RISE UP PuTflNO^OTT STAXS^ 
_150_LET AIM 
160 LET D»D*» 

_1_70 PRINT » AND IT IS DAWN" 
180 CO TO 1350 

100 PRINT " INTO THE STREET OF THE SKY LIGHT" 
800 LET A2nT 
210 LET DtD*l 

^20 PRINT " WALKS SCATTERING POEMS" 
230 GO TO 1350 

U Z r P R I NT "ON E A R T H A C A N L E 1 8 E X T I N U I SE D » 
250 LET A3ii 

270 PRINT " THE CITY WAKES" 
"280 GO TO 1350 

290 PRINT "WITH A SONO UPON HER MOUTH" 

300 LET A4tl 

310 LET D>D *1 

320 PRINT » 

330 60 TO 1350 

340 PRINT "AND IT IS DAWN" 

350 PRINT " 
"360 LET ASH 

370 LE T DiD*l 

380 PRINT "" GOfSTMT^ 

390 GO TO 1350 
"400 PRINT " AND IT IS DAY" 

410 LET C5<*1 

420 LET D»D*1 

430 GO TO 1350 

140 PRINT "TT¥THT WTRlHJjri 3TE 

450 PRINT " SCREAMS" 

450 LET Di 0*1 

470 LET C5il 

480 PRINT "FOR HE IS ME" 

490 LET DiD*l 

5WTRXNT ""*" Wo i HEW 

510 GO TO 1350 
"520 PRINT "AND IT IS DUSK" 

530 LET A7il 

540 LET DtD+1 

550 PRINT » ON EARTH" 

"5«0~OOTO 1350 

570 PRINT "A CANDLE IS LIGHTED" 

580 LET A8«l 

590 LET DtD+1 

600 PRINT " AND IT IS DARK" 

610 00 TO 1350_ 

8WFRTNT "THE "PEOPLE ARE IN "THEIR "HOUSES" 

630 LET A9M 

640 LET OiDM 

650 GO TO 1350 

660 PRINT "SHE SLEEPS WITH DEATH UPON HER MOUTH" 

670 LET 81H 

6T0 LET DiD*i 

690 PRINT " AND A SONG IN HER EYES" 

700 GO TO 1350 

710 PRINT " THE HOURS DESENDED" 

720 LET B2il 

730 LET DfD*l 

740 PRINT " PUTTING ON STARS" 

750 GO TO 1350 

760 PRINT "NOBODY LOSES ALL THE TIME " 

77d LET B3H 

780 LET DiD*l 

'90 GO TO^1350_ ___ 

800 PRINT "HIS MOST WISE MUSIC STOLE" 

8^0 LET B4»l 

820 LET DnD*l 

830 PRINT " NOTHING FROM DEATH" 

840 GO TO 1350 

880 PRINT "LOVE IS THE^EVER ONLY GOD" 

860 LET BSti 

870 LET DtD*l 

880 GO TO 1350 

890 PRINT "WHO SPOKE THIS EARTH SO GLAD AND BIG" 

900 LET B6H 

910 LET D»D*1 

9"20~T R I NT « E V EN A THING A L L 3 M A L L A ND 6 A D " 

930 GO TO 1350 

940 PRINT "WHO IS AFRAID OF DEATH?THOu M 

950 LET B7il 

960 LET D»D*1 

970 PRINT " ART OF Htmh 

980 00 TO 1350 

990 PRINT "OR WITH THY MIND AGAINST MY MIND," 

1000 LET 88(11 

1010 LET DiD*l 

1020 PRINT « YOU SHOULD NOT HEAR ME SPEAK" 

10 30 G O TO 1350 __ 

1040 PR7NT ""FOR IF HE IS GONE AND I AM HERE" 

1050 LET B9il 

1060 LET DtD*l 

1070 PRINT " THERE IS NO MEETING" 

1080 GO TO 1350 

1090 PRINT " TIME IS TWISTED TO LAP UPON" 

ri00~LTT ClM 

1110 LET DiD*l 

1120 PRINT " ITSELF FOREVER" 

1130 GO TO 1350 

1140 PRINT "AND SPACE IS MISINq pOR IT WAS « 

U50 LET C2it 
"TT6TXFT"0T0*~J 

1170 PRINT "STOLEN FOR ALL TIME TO COME » 

1180 GO TO 1350 

1190 PRINT "THERE IS NEVER AN END," 

1200 LET C3il 

1210 LET DiD*l 

J"2WTRINT "~ MERELY A BELATED BEGINING. , , " 

1230 GO TO 1350 

1240 PRINT "AND TWICE REPEATED THERE" 



1250 LET C4»l 

1210 pRTNT '""»' WAS NO MORE" 

1270 GO TO 1350 

[Wtt PRINT 

1281 DtD*i 

1290 60 TO 1350 

1300 PRINT » RANDOM POETRY IN FOUR PART HARMONY," 

1310 PRINT 

1328 PRINT 

1330 IF QiXNT(QT~THEN 12 8"0 
1340 IF D«12 THEN 2330 
1350 LET XiRND(»l)*24 
1360 LET XHINT(X)*1 
T361 IF Dt4 THEN 1280 

1362 IF Di8 THEN1280 

1363 IF E»l6 THEN 2330 
1370 IF X1H THEN 1390 
1380 GO TO 1410 
1390__IF AU1 THEN 1410 

1400 if xiM Then 140 

1410 IF Xli2 THE N 1430 
1420 GO TO 1450 
U30^lF„A2tl_THEN 1450 
1440 IF Xli2 THEN 290 
1450 IF Xl*3 THEN 1470 
1460 GO TO 1490 
1470 IF A3 il TH EN 1 490 
"1480 IF XliS THEN 190" 
1490 IF Xl»4 THEN1510 
1600 GO TO 1530 
JL510 IF A4il THEN 1530 
1320 IF XIM THEN 240 
1530 I F X li5 THEN 1550 
1540 GO TO 1570 
1550 IF A5P1 THEN 1570 
1560 IF Xl«5 THEN 340 
1570 IF Xl*6 THEN 1590 
1580 GO TO 1610 
1590 IF A6w 1 THEN 1610 
1600 IF Xl*6 THEN 400 
1610IF XH7 THEN 1630 
1620 GO TO 1650 
1630 IF A7«t THEN 1650 
1640 GO TO 520 
16 50 IF XU8 THEN 1670 
1660 GO TO 169e 
1670 IF A8H THEN 1690 
1660 GO TO 570 
1690 IF Xtt9 THEN 1710 
1700 GO TO 1730 
1710 IF A9"l THEN 1730 
1720 GO TO 620 
1730 IF Xi«10 THEN 1750 
1740 GO TO 1780 
1750 GO TO 1760 
1760 IF Bl«l THEN 1780 
177g G O TO 660 
1780 IF XiiiT THEN ["1800 
1790 GO TO 1820 
1800 IF B2»l THEN 1820 
1810 GO TO 710 
1820 IF X1H2 THEN 1840 
1830 GO TQ_ U60 
1840 IF B3il THEN i860 
1850 GO TO 760 
I860 IF XH13 THEN 1880 
1870 GO TO 1900 
1880 IF B4»l THEN 1900 
1890 GO TO 800 _ 
19 00 IF XI §14 THEN 1920 ~ 
1910 GO TO 1940 
1920 IF BSil THEN 1840 
1930 GO TO 850 
1940 IF XU15 THEN I960 
1950 GO TO 1980 
T9W IF ~B6<fi THEN 1980 
1970 GO TO 890 
1980 IF XH16 THEN 2000 
1990 GO TO 2020 
2000 IF B7il THEN 2020 
2010 GO TO 940 
2020 IF X1H7 THEN 2040 
2030 GO TO 2060 
2040 IF BSil THEN 2060 
2050 GO TO 990 
"2060 IF XiiiS THEN 2080 
2070 60 TO 2100 

2fs0""rr : i 9 rfTHwrm 

2090 GO TO 1040 

2100 IF X1M9 THEN 2120 

2110 GO TO 2140 

2120 IF Ciil THEN 2140 

2130 GO TO 1090 

W0 TF"X!«207THEN 2160 ' 

2150 GO TO 2180 

2160 IF C2*i THEN 2180 

2170 GO TO 1140 

2180 IF Xl«21 THEN 2200 

2190 GO TO 2220 

2W0 IF"C3i"l THEN 22W 

2210 GO TO 1190 

2220 IF Xl«22 THEN 2240 

2230 GO TO 2260 

2240 IF C4»t THEN 2260 

2250 GO TO 12 40 

2260 IF X1»23T THEN 2280" 

2270 GO TO 2300 

2280 IF C5H THEN 2300 

2290 GO TO 440 

2300 GO TO 2320 

2310 IF XH 24 T HEN 1280 

2320 GO~TO~t360 

2330 PRINT 

2340 PRINT 

2350 PRINT " 1 nr\ 

2360 END X / U 



SAMPLE RUN 

RANDOM POETRV IN FOUR PART HARMGNV. 



TIME IS TWISTED TO LAP UPON 
ITSELF FOREVER 
NOBODV LOSES RLL THE TIME 

FIND IT IS DAWN 

THE WORLD 
GOES FORTH TO MURDER DREAMS 
HIS MOST WISE MUSIC STOLE 

NOTHING FROM DEATH 
AND IT IS DUSK 

ON EARTH 

THE PEOPLE ARE IN THEIR HOUSES 
SHE SLEEPS WITH DEATH UPON HER MOUTH 
AND A SONG IN HER EVES 
THE HOURS DESENDED 

PUTTING ON STARS 
THE HOURS RISE UP PUTTING OFF STARS 

AND IT IS DAWN 
WITH A SONG UPON HER MOUTH 

HAVING DEATH IN HER EVES 
WITH A SONG UPON HER MOUTH 

HAVING DEATH IN HER EVES 
IN THE MIRROR I SEE A MAN, AND HE 

SCREAMS 
FOR HE IS ME 

AND I HE 



BV A. COM PUTER. 



RANDOM POETRV IN FOUR PART HARMONV. 



TIME IS TWISTED TO LAP UPON 
ITSELF FOREVER 
NOBODV LOSES ALL THE TIME 

AND IT IS DAWN 

THE WORLD 
GOES FORTH TO MURDER DREAMS 
HIS MOST WISE MUSIC STOLE 

NOTHING FROM DEATH 
AND IT IS DUSK- 
ON EARTH 

THE PEOPLE ARE IN THEIR HOUSES 
•=:HE SLEEPS WITH DEATH UPON HER MOUTH 
AND ft SONG IN HER EVES 
THE HOURS DESENDED 

PUTTING ON STARS 
THE HOURS RISE UP PUTTING OFF STARS 

AND IT IS DAWN 
WITH A SONG UPON HER MOUTH 

HAVING DEATH IN HER EVES 
WITH A SONG UPON HER MOUTH 

HAVING DEATH IN HER EVES 
IN THE MIRROR I SEE ft MAN, AND HE 

SCREAMS 
FOR HE IS ME 

AND I HE 



COM PUTER. 



BY A, COM PUTER," 



POET 



PROGRAM LISTING 



SAMPLE RUN 



90 RANDOMIZE 

100 IF lot THEN 101 ELSE PRINT "MIDNIGHT DREARY"! 

101 IF I<>2 THEN 102 ELSE PRINT "PIREY EYES"! 

102 IF I<>3 THEN 103 ELSE PRINT "BIRD OR FIEND"! 

103 IF I<>4 THEN 104 ELSE PRINT "THING OF EVIL"! 

104 IF I<>5 THEN 210 ELSE PRINT "PHOPHET"! 

105 GOTO 210 

110 IF I<>1 THEN HI ELSE PRINT "BEGUILING ME"! 

111 IF I<>2 THEN 112 ELSE PRINT "THRILLED ME"! 

112 IF I<>3 THEN 113 ELSE PRINT "STILL SITTING. ., »\GOTO 212 

113 IF I<>4 THEN 114 ELSE PRINT "BURNED. "\GOTO 212 

114 IF I<>5 THEN 210 ELSE PRINT "NEVER FLITTING"! 

115 GOTO 210 

120 IF I<>1 THEN 121 ELSE IF U-0 THEN 210 ELSE PRINT 

121 IF I<>2 THEN 122 ELSE PRINT "AND MY SOUL"! 

122 IF I<>3 THEN 123 ELSE PRINT "DARKNESS THERE"! 

123 IF I<>4 THEN 124 ELSE PRINT "SHALL BE LIFTED"! 

124 IF I<>5 THEN 210 ELSE PRINT "QUOTH THE RAVEN"! 

125 GOTO 210 

130 IF I<>1 THEN 131 ELSE PRINT "NOTHING MORE"! 

131 IF I<>2 THEN 132 ELSE PRINT 

132 IF I<>3 THEN 133 ELSE PRINT 



SIGN OF PARTING"! 



133 IF I<>4 THEN 134 ELSE PRINT 



"YET AGAIN"! 
"SLOWLY CREEPING"! 
.NEVERMORE"! 



134 IF I<>5 THEN 210 ELSE PRINT "EVERMORE."! 

210 IF Us0 THEN 212 ELSE IF RND>,19 THEN 212 ELSE PRINT ","|\U"2 

212 IF RND>.65 THEN 214 ELSE PRINT " " ! VU«U+1\G0T0 215 

214 PRINT\U«0 

215 I«INT(5*RND*1) 
220 J«J+1\K»K+1 

230 IF U>0 THEN 240 ELSE IF INTCJ/2)<>J/2 THEN 240 ELSE PRINT " 

240 ON J GOTO 100,110,120,130,250 

250 J*0\PRINT\IF K>20 THEN 270 ELSE GOTO 215 

270 PRlNT\Us0VK«0VGOTO 110 

999 END 



NOTHING MORE, 



THING OF EVIL BEGUILING ME, 
DARKNESS THERE 

SLOWLV CREEPING 
FIREV EVES BEGUILING ME SHALL BE LIFTED, 
THING OF EVIL 

THRILLED ME 
SHALL BE LIFTED VET AGAIN 



STILL SITTING. . . 
FIREV EVES 

THRILLED ME AND MV SOUL VET AGAIN 

MIDNIGHT DREAR V BEGUILING ME 

SHALL BE LIFTED VET AGAIN, 

THING OF EVIL, NEVER FLITTING DARKNESS THERE 

. . . NEVERMORE 
BIRD OR FIEND BEGUILING ME, SHALL BE LIFTED ...NEVERMORE 

MIDNIGHT DREARV BEGUILING ME SIGN OF PARTING 
. . . NEVERMORE 

BEGUILING ME 

THING OF EVIL BURNED. 

GUOTH THE RAVEN 

SLOWLV CREEPING 

FIREV EVES 

THRILLED ME GUOTH THE RAVEN EVERMORE. 

PHOPHET 

THRILLED ME SHALL BE LIFTED 
NOTHING MORE 

THING OF EVIL 

STILL SITTING. . . 
DARKNESS THERE VET AGAIN 
MIDNIGHT DREAR V, 

STILL SITTING. . 

SHALL BE LIFTED SLOWLV CREEPING, 

BEGUILING ME PHOPHET, 
BURNED. 
SHALL BE LIFTED EVERMORE. 
FIREV EVES STILL SITTING. . . 
SIGN OF PARTING VET AGAIN 
MIDNIGHT DREARY BURNED. 

DARKNESS THERE VET AGAIN 
MIDNIGHT DREARV, BURNED. 
DARKNESS THERE, 
EVERMORE. 
MIDNIGHT DREARV BURNED. 
GUOTH THE RAVEN 
EVERMORE. 



NEVER FLITTING FIREV EVES THRILLED ME SIGN OF PARTING NOTHING MORE, 
BIRD OR FIEND BEGUILING ME 
SHALL BE LIFTED VET AGAIN 
FIREV EVES 

THRILLED ME GUOTH THE RAVEN, . . . NEVERMORE 
THING OF EVIL 
BURNED. 

DARKNESS THERE EVERMORE. 
THING OF EVIL BURNED. 

SHALL BE LIFTED EVERMORE. 

THRILLED ME 

FIREV EVES NEVER FLITTING 

AND MV SOUL SLOWLV CREEPING 

BIRD OR FIEND THRILLED ME, SIGN OF PARTING- 
NOTHING MORE 

FIREV EVES 

BEGUILING ME DARKNESS THERE 
VET AGAIN 

MIDNIGHT DREARV 

STILL SITTING. . . 
SIGN OF PARTING 
NOTHING MORE 

PHOPHET BEGUILING ME, AND MV SOUL 
VET AGAIN 



THRILLED ME BIRD OR FIEND 

THRILLED ME SIGN OF PARTING . . . NEVERMORE 
BIRD OR FIEND THRILLED ME, GUOTH THE RAVEN ...NEVERMORE 
BIRD OR FIEND 

THRILLED ME SHALL BE LIFTED NOTHING MORE 
FIREV EYES 

NEVER FLITTING DARKNESS THERE VET AGAIN 
BIRD OR FIEND THRILLED ME, DARKNESS THERE NOTHING MORE 



BURNED. 

thing of evil never flitting guoth the raven, 

nothing More 
midnight drearv 

thrilled me darkness there vet again, 
midnight drearv 7.':.. 

beguiling me darkness there 

vet again \ 
midnight drearv still sitting. . . 
shall be lifted slowly creeping 
thing of evil beguiling me 
darkness there . . . nevermore 



FIREV EVES 

STILL SITTING. . 
AND MV SOUL EVERMORE. 



171 



FIREV EVES NEVER FLITTING GUOTH THE RAVEN 

. . . NEVERMORE 
MIDNIGHT DREARV 

THRILLED ME 
GUOTH THE RAVEN 



POKER 



PLAY DRAW POKER 



Description 



In this game, you play draw poker with the computer as your 
opponent. At the start of the game, each person has $200. 
The game ends when either opponent runs out of money (if you 
run short, the computer gives you a chance to sell your 
wristwatch or diamond tie tack). 

The computer opens the betting before the draw; you open the 
betting after the draw. If you don't have a hand that's worth 
anything and want to fold, bet 0. Prior to the draw, to check 
the draw, you may bet .5. Of course, if the computer has 
betted, you must match bets (see his bet) in order to draw or, 
if your hand looks good either before or after the draw, you 
may always raise the bet. 

Source 

Thanks to A.E. Sapega for submitting this program to DECUS 
(BASIC 8-556). Its author is: 

A. Christopher Hall 
Trinity College 
Hartford, CT 06106 



Why Does It ALWAYS HAPPEN That... 








WJHk 


'■kt**^ 


«wf«s(] 


... your only Full House of 
the night loses to the only 
Four-Of-A-Kind of the night? 



1 973 by E . C . Publications 



172 



PROGRAM LISTING 

TDIMA~(15),Bn6, 
2DEFFNA(X)"INT(10*RND(X), 
TDl F f Nl ( X) ■ X • 1 00 * I N f ( X / 1 ) 

4PRINT"WELC0ME TO THE HAUDEN CASINO. WE EACH HAVE $200* 
5PRINT"! WILL OPEN THE BETTING TEP~ORE~TH£ "DRAWir YOTTOPfN~AFTE^ 
^PRINT"WHEN YOU FOLD, BET 0) TO CHECK, BET ,5» 
7PRINT»ENOUGH TALK — LET'S GET DOWN TO BUSINESS" 
SPRINT 
9LET0M 
10LETC"200 

i2LETP*0 

ISRANDOM 

UPRINT 

i5TFC<"STHEN367 

16FRINT "THF ANTE IS S5. I WILL DEAL" 

17PRINT 

t8IF8»5THEN20 

f9GOSUB383 

2_0LETP»P*10 

2lLETS«S-5 

22LETC»C»S 

23FQRZ*ITO10 

24G0SUB174 

2SNEXTZ 

26PRINT"Y0UR HANDl" 

27LETN-1 

28G08UB185 

29LETN»6 

30LETI-2 

31G0SUB217 

32PRINT 

33IFI«>6THEN47 

34IFFNA(0)<»7 THEN37 

35LETX*ill00 

36G0T042 

37IFFNA(0)<«7THEN40 

38LETXM1110 

39G0T042 

40iffna ( ) >■ 1 t he n 4 5 
4iletx"THi; 

42LETI-7 
43LETZ-23 
44G0T058 
45LETZ«1 
46G0T051 
47IFU>»13THEN54 
48IFFNAC0)>«2THEN50 
49G0T042 
50LETZ»0 
51LETK»0 

52PRI_NT"I CHECK" 
53G0T062 
54IFU<»i6THEN57 
5SLETZ-2 

56IFFNA(0)>«1THEN58 
57LETZ»35 
S8LETV"Z*FNA(0) 
59G0SUB348 

60PRINT»I»LL OPEN WITH "V 
61LETMV 
62GOSUB305 
63G0SUB65 
64G0T082 
65IFI03THEN76 
66PRINT 

67PRINT"I WIN" 
68LETC«C*P 

69PRINT M N0W I HAVE $»C«AND YOU HAVE $»S 
70PRINT«DO YOU WISH J"Q CONTINUE"! 
TTlNPUTHi 
72IFH$«»YES"THEN12 
73iFHS»«NO«THEN410 
74PRINT»'AN3WER YES OR NO, IDIOT" 
75GOTO70 
76IFKMTHEN81 
77PRINT 

78PRINT"Y0U WIN" 
79LEtS«S+P 
80GOTO69 
SlRETURN 
82PRINT 

8 3 P R I NT ,r N"OW W E WA W -• • HOW MANY CARDS SO YOU *ANT«f 
84INPUTT 
85IFT«0THEN98 
86LETZ«10 
87IFT«4THEN90 

88PRIN T"Y0U CAN'T DRAW MORE THAN THRE P CARDS" 
S9G0f0ff4 

90PRINT"WHAT ARE THEIR NUMBERS" 
9 IFOR Q"iTOT 
92INPUTU 
93G0SUB173 
94NEXTQ _ 
95PRINT" YOUR NE W ""HANOI " 
96LETN»i 
97G0SUB165 
98LETZ"10+T 
99FORU-6TO10 

100IFINTCX/10A(U-6))<>10*INT(X/10A(u-5nTHEN102 
I01GOSUBT73 
102NEXTU 
T03PRINT 

104PRINT"! AM TAKING»Z»i0-T"CARD«| 
t05lFZ»ll*TTHENl09 
106PRINT' 'S" 
107PRINT" 
108GOTOH0 
109PPINT 
110LETN«6 
111LETV»I 
112LETI«1 

IULETBpu 
TiSjJETM-D 
il6IFV<»7THEN119 
ii7LETZ»28 
U8G0T0133 
lT9lTr<>6THlNf22 
120LETZM 
121G0T0133 
122IFU>»13THEN127 



l23LETZi2 

124IFFNA( 0)<»6THEN126 
l25LETZif9 
126G0T0133 
1 27 1 FU>" 16 THEN 132 
128LETZ«19 

12 9 IF F N A ( ) 08THEN131 
130LETZM1 
131G0T0133 
132LETZ"2 
133LETM0 
13_4GOSUB305 
i36IFT<>.5THEN146 
136IFV»7THEN140 
137IFIO6THEN140 
_1_38PRINT"I«LL CHECK" 
139G0T0146 
140LETV«Z*FNA(0) 
141G0SUB348 
142PR INT"I'LL BET"V 



143LETK»V 
J44GOSUB306 
14SG0SUB65 
J_46PRINT 

147PRINT«N0W WE COMPARE HANDS" 
148LETJf HS 
149LETK$«I$ 
JJ50PRINT«MY HANDl" 
151LETNB6 
J52G0SUBJ85 
153LETN»i 
154G03UB21 7 
1S5PRINT 

156PRINT"Y0U HAVE «> 
157LETK«D 
158G0SUB369 
169LETH$»J$ 
160LET I$«KS 
161LETK«M 

162PRINT»AND I HAVE «| 
163G0SUB369 
164IFB»UTHEN67 
165IFU>BTHEN78 
166IF HS»" A FLU3»THEN170 
" 167PR"INT"THE HAND IS" DRA WN« 
168PRINT"ALL $"P« REMAIN IN THE POT" 
169G0T014 

170IFFNB(M)>FNB(D)THEN67 
171IFFNB(0)>FNB(M)THEN78 
172 G0T0 167 
173LETZPZ+1 

174LETA(Z)«INTC1000*RND(0)) 
175IFINT(A(Z)/100)>3THEN174 
176IFACZ)-100*INT(A{Z)/100)>12THEN174 
177FORK»1TOZ-1 
178I FA(Z)»A(K)THEN174 
"T79NEXTK" 
180IFZ<»10THEN184 
181LETN«A(U) 
182LETA(U)«A(Z) 
183LETACZ)*N 
184RETURN 
TMF0RZ«NT0~N*4 
186PRINTZ"— «> 
187G0SUB195 
188PRINT" OF"; 
189GOSUB207 

190IFZ/2<>lNT(Z/2)THENi92 
T^IPRINT "'" 
192NEXTZ 
193PRINT 
194RETURN 
195LETK»FNBCA(Z)) 
196IFK09THEN196 
197PRINT"JACK«I 
198IFKO10THEN200 
199PRINT«QUEEN«J 
200IFK<»liTHEN202 
201PRINT«KING«| 
20 2IFKQ 12THEN204 
T0TPPI¥T""TC : E " I 
204IFK>»9THEN206 
205PRINTK+2I 
206RETURN 

207LETK»INT(A(Z)/100) 
208IFKQ0THE N21 
209PRINT T ' CLUBS", 
210IFKO1THEN212 
211PRINT" DIAMONDS", 
212IFK02THEN214 
213PRINT" HEARTS", 
214IFK Q3THEN216 
215PRINT« SPADTS", 
216RETURN 
217LETU-0 
2i8F0RZ"NT0N*4 
219LETB(Z)»FNBCA(Z)) 

220IFZ»N*4THEN223 _ 

221IFINT(ATZT/ 100) <>TnT(X(I* i ) /T00") THE N223 

222LETU"U+1 

223NEXTZ 

224IFU<>4THEN231 

225LETX»11111 

226LET D ■ AJJY 5 

227LETH$««A FLUS" 

228LETI$«»H IN" 

229LETU"15 

230RETURN 

231F0RZ"NT0N*3 

232F0RK«Z*iT0N*4 

2T31TBTn «~iBTKl THFN239 

234LETX*A(Z) 

235LrTA(z)«A(K) 

236LEtB(Z)»B(K) 



237lETA(K)bX 

238LETB(K)tA(K)-100*lNT(A(K)/100> 

239NEXTI 

240NEXTZ 

241LETX»0 

242F0RZ*NT0N*3 

2 43 IF B (I) * > B ( Z * 1 7 T H E N 2 4 7 

244LETXiX» lU10A(Z»N) 

246LETD«A(Z) 
J46G08UB276 

247NEXTZ 

248IFXO0THEN262 
"249lFB(N)*3<>B(N*3)THEN252 

2 50LETX«111 1 

2^1LETU«10" 

2S2IFB(N4.1)4-3«>B(N*4)THEN262 
~283IFUO10THEN260 

254LETUiil4 

2SSLETH$»»8TRAIG» 

2|6J-ETIS«^HT^ 

287LETX*11111 
JS8LETD«A(N*4) 

289RETURN 

260LETU-10 

261LETX-11U0 

262IFU>«10THEN269 

263LETD»A(N*4) 

264LETHS»«SCHMAL" 

265LETI$»"TZ, " 

266UTU»9 

267LETX* 11000 

268G0T0274 

269IFU«>10THEN272 
^2701FIilTHEN274 

271G0T027S 

272IFU>12THEN275 

273IFFNB(D)»6THEN275 

274LETIP6 

275RETURN 

276IFU>*11THEN281 

277LETU«U 

278LETH$-"A PAIR" 

279LETI$«« OF » 

280RETU RN 

281IFU<MfTHEN291 

282IFB(Z)<>BCZ-1)THEN287 

283LETHS»"THREE" 

284LETI$»" » 

28SLETU-13. 

286RETURN 

287LETH$«"TW0 P"« 

288LETI$»»AIR, « 

289LETU»12 

290RETURN 

291IFU012THEN296 

292LETU*16 

293LETHSi"FULL H« 

294LETI$«"0USE, » 

295RETURN 

296IFB(Z)«>BCZ»1)THEN301 

297LETU«17 

298LETH$»"F0UR« 

T99LETI«inn~" 

300RETURN 

301LETUH6 

302LETH$«"FULL H" 

303LETI$»«OUSE, » 

304RETU RN 

305LETGP0 

306PRINT«WHAT IS YOUR 8ET«I 

307INPUTT 

308IFT«INT(T)«0THEN314 

309IFKO0THEN312 

3^0IFG<»0THEN312 

1 ITITT ■ ,~5T"H EN 341 

312PRINT«N0 SMALL CHANGE, PLEASE" 

313GOTO306 

314IFS«G-T>*0THEN317 

31SG08UB383 

3166OTO306 
"3TriTT«>0THEN320 

318LETI"3 

319G0T0338 

320IFG*T>«KTHEN323 

321PRINT«IF YOU CAN'T SEE MY BET, THEN FOLD" 

322GOTO306 

323LETG*G*T " 

324IFG*KTHEN338 

32BIFZ01THEN342 

326IFG>5THEN330 

327IFZ>"2THEN335 

328LETV-5 

329G0T0342 

330IFZi»lTHEN332 

33ilFT<825THEN335 

332LETI»4 

333PRINT«I FOLD" 

334RETURN 

335IFZ»2THEN343 

336PRINT M I'LL SEE YOU" 

337LETK«G 

338LETS»S«G 

"339LETC*C»K 

340LETP «P*G*K 

341RETURN 

342IFG>3*ZTHEN33S 

343LETV«G-»K*FNAC0) 

344G0SUB348 

348PRINT»I'LL SEE YOU, AND RAISE Y0U'»V 

346LETK»G *V 

347GOTO306" 

348IFC-G-V>"0THEN366 

349IFGO0THEN352 

3B0LETV-C 



173 



351RETURN 

162IFC»G>«0THEN336 

J53XFO/2<»INT(O/2)THEN360 

384PRINT_«W0ULD YOU LIKE, TO BUY BACK YOUR WATCH FOR $50"! 

355INPUTJS 

35SIFJ$i"NO»THEN360 

387LETC"C*50 

358LET0»0/2 

3S9RETURN 

360IFO/3«>INTCO/3)THEN367 _ 

36l~PRINT"WQULD YOU LIKE TO BUY BACK YOUR TIE TACK FOR $50«> 

362INPUTJS 

363"IFJ$«»N0»THEN367 

364LETC«C»B0 

365LET0P0/3 

366RETURN 

367PRINT»I«M BUSTED. CONGRATULATIONS" 

3688T0P 

369PRINTH$»I$| 

370IFH$o»A FL U8*THEN375 

37lLETKtlNT("K/100) 

372COSUB208 

373PRINT 

374RETURN 

37SLEfK»FNB(K) 

376008UB196 

3T7IFH $ » " S C H M A L »• f H I N 379 

378IFH$<>»STRAlG"THEN38i 

379PRINT" HIGH" 

380RETURN 

"38iPRX'NT»8* 

382RETURN 

383PRINf 

384PRINt h Y0U CAN«T BET WHAT YOu HAvEN»T GOT" 

T8SIFO/2»INTCO/2)THEN397 

386PRINT"W0ULD YOU LIKE TO SELL YOUR WATCH"! 

387INPUTJS 

388 lFjS»"N 0_»_T H E N 3 97 

I89~I F F N A ( 01 > ■TTH E N 393 

390PRINT"I'LL GIVE YOU $76 FOR IT" 

391LETS»S*75 

392G0T0395 

393PRINT"THAT«8 A PRETTY CRUMMY WATCH - I'LL GIVE YOU $2S" 

394LETSiS*2S 

395LET0»0*2 

396RETURN 

3"97IFO/3"INTCO/3)THEN409 

398PRINT"WILL YOU PART WITH THAT DIAMOND TIE TACK"! 

399INPUT J$ 

400lFJSi«NO»THEN408 

401IFFNX(0T>"»6THEN405" 

402PRINT"YOU ARE NOW $100 RICHER" 

403LET8«S*100 

404GOTO407 

405PRINT«IT«S PASTE. $25« 

406 LETS tS»26 

407LETO«O^3 

408RETURN 

409PRINT"YOUR WAD IS SHOT, SO LONG, SUCKER" 

410END 

SAMPLE RUN 

WELCOME TO THE HALLDEN CASINO. WE EACH HAVE *2O0 

I WILL OPEN THE BETTING BEFORE THE DRAW; VOU OPEN AFTER 

WHEN VOU FOLD, BET 8; TO CHECK, BET .5 

ENOUGH TALK — LET'S GET DOWN TO BUSINESS 



NOW WE DRAW — HOW MANY CARDS DO VOU WANT? 3 

WHAT ARE THEIR NUMBERS 

? 1 

? 4 

? 5 

YOUR NEW HAND: 
1 — 8 OF DIAMONDS 2 — 9 OF DIAMONDS 
3 — KING OF CLUBS 4 — 4 OF DIAMONDS 

5 — 5 OF DIAMONDS 

I AM TAKING 3 CARDS 

WHAT IS .YOUR BET? 6 

I WIN 

NOW I- HAVE * 208 AND VOU HAVE * 200 

DO VOU WISH TO CONTINUE? YES 

THE ANTE IS *5. I WILL DEAL 



YOUR HAND: 

1 — 5 OF" DIAMONDS 

3 — 5 OF CLUBS 

5 — 5 OF SPADES 



— KING OF CLUBS 
4 OF CLUBS 



I'LL OPEN WITH 31 

WHAT IS VOUR BET? 20 

IF VOU CAN'T SEE MY BET, THEN FOLD 

WHAT IS YOUR BET? 31 

NOW WE DRAW — HOW MANY CARDS DO YOU WANT? 2 

WHAT ARE THEIR NUMBERS 

? 2 

? 4 

VOUR NEW HAND: 
1 — 5 OF DIAMONDS 2 — JACK OF HEARTS 
3 -- 5 OF CLUBS 4 — 7 OF DIAMONDS 

5 __ 5 0F SPADES 

I AM TAKING 2 CARDS 

WHAT IS YOUR BET? 20 

I'LL SEE YdU, AND RAISE VOU 28 

WHAT IS VOUR BET? 28 



NOW WE COMPARE HANDS 






MY HAND: 






6 — 4 OF SPADES 






7 — 4 OF DIAMONDS 


8 — 


9 OF HEARTS 


9 — KING OF DIAMONDS 


10 — 


ACE OF spade: 



YOU HAVE THREE 5 S 

AND I HAVE A PAIR OF 4 S 

VOU WIN 

NOW I HAVE $ 116 AND VOU HAVE $ 284 

DO VOU WISH TO CONTINUE? YES 

THE ANTE IS $5. I WILL DEAL 

YOUR HAND: 

1 -- 9 OF HEARTS 

3 -- 7 OF DIAMONDS 

5 — 4 OF SPADES 

I CHECK 

WHAT IS YOUR BET? 



JACK OF HEARTS 
KING OF DIAMONDS 



THE ANTE IS *5. I WILL DEAL 

VOUR HAND: 
1 — 7 OF SPADES 
3 — OUEEN OF SPADES 
5 — 6 OF CLUBS 

I CHECK 

WHAT IS YOUR BET? 5 

I'LL SEE VOU 



NOW WE DRAW — HOW MANY CARDS DO VOU WANT? 3 

WHAT ARE THEIR NUMBERS 

? 2 

? 3 

? 5 

VOUR NEW HAND: 

1 -- 7 OF SPADES 2 — 

3 -- 7 OF HEARTS 4 — 

5 — 5 OF DIAMONDS 

I AM TAKING 3 CARDS 

WHAT IS VOUR BET? 20 
I FOLD 

VOU WIN 

NOW I HAVE * 190 AND VOU HAVE * 210 

DO VOU WISH TO CONTINUE? YES 



OF SPADES 
OF DIAMONDS 



JACK OF DIAMONDS 
7 OF DIAMONDS 



THE ANTE IS *5. 

VOUR HAND: 
1 — 4 OF HEARTS 
3 — KING OF CLUBS 
5 — 8 OF SPADES 

I CHECK 

WHAT IS VOUR BET? 5 

I'LL SEE VOU 



I WILL DEAL 



2 — 
4 — 



OF DIAMONDS 
OF DIAMONDS 



I WIN 

NOW I HAVE * 121 AND YOU HAVE * 279 

DO VOU WISH TO CONTINUE? VES 

THE ANTE IS $5. I WILL DEAL 



2 — GMJEEN OF HEARTS 
4 — 3 OF CLUBS 



YOUR HAND: 
1 — 8 OF SPADES 
3 — 9 OF SPADES 
5 — 10 OF DIAMONDS 

I CHECK 

WHAT IS YOUR BET? 5 

I'LL SEE YOU 



NOW WE DRAW — HOW MANV CARDS DO VOU WANT? 1 

WHAT ARE THEIR NUMBERS 

? 4 

VOUR NEW HAND: 

1 -- 8 OF SPADES 

3 — 9 OF SPADES 

5 — 10 OF DIAMONDS 



2 — 
4 — 



QUEEN OF HEARTS 
KING OF CLUBS 



I AM TAKING 3 CARDS 



WHAT IS VOUR BET? 5 
I'LL SEE VOU 



NOW WE COMPARE HANDS 






MY HAND: 






6 — 7 OF SPADES 






7 — 7 OF CLUBS 


8 — 


8 OF CLUBS 


9 — JACK OF SPADES 


10 — 


ACE OF SPADES 



YOU HAVE SCHMALTZ, KING HIGH 

AND I HAVE A PAIR OF 7 S 

I WIN 

NOW I HAVE * 136 AND VOU HAVE * 264 

DO VOU WISH TO CONTINUE? VES 



174 



QUBIC 



3 -DIMENSIONAL TIC-TAC-TOE 



Description 



QUBIC is the game of tic-tac-toe in a 4x4x4 cube. You must get 
4 markers in a row or diagonal along any 3 -dimensional plane 
in order to win. It is up to you to keep track of moves (the 
program does not print out a diagram as you play). 

Each move is indicated by a 3 -dig it number (digits not separated 
by commas), with each digit between 1 and 4 inclusive. The 
digits indicate the level, column, and row, respectively, of 
the move. You can win if you play correctly; although, it is 
considerably more difficult than standard, two-dimensional 3x3 
tic-tac-toe. 

Source 

QUBIC seems to have first shown up on a G.E. timesharing system 
in 1968. Its original author is unknown. 




175 



PROGRAM LISTING 

REN # QUBXC- * 

5 print "do you want instructions «f 

6 INPUT C« 

7 IF CS»»NO« THEN 21 

8 IF C|»"YES" THEN 13 

9 PRINT "INCORRECT ANSWER. PLEASE TYPE » YES ■ OR INO'"j 

10 GOTO « 

13 PRINT "THE GAME IS TIC-TAC-TOE IN A 4 X 4 X 4 CUBE." 

14 PRINT "EACH MOVE IS INDICATED BY A 3 DIGIT NUMBER, WITH EACH" 

15 PRINT "DIGIT BETWEEN 1 AND 4 INCLUSIVE. THE DIGITS INDICATE THE" 

16 PRINT "LEVEL, COLUMN, AND ROW, RESPECTIVELY, OP THE OCCUPIED PLACE," 

20 DIM XC64),LC76),MC76,4),YC16) 

21 FOR I m 1 TO 16 

22 READ Y(I) 

23 NEXT I 
24FOR I«l TO 76 
25FOR J » 1 TO 4 

26 READM(I,J) 

27 NEXT J 

28 NEXT I 

35 FOR I b 1 TO 64 
40 LET X CD b0 
50 NEXT I 

54 LET Z«l 

55 PRINT "DO YOU WANT TO MOVE FIRST" I 
60 INPUT SI 

66 IF SI""NO" THEN 110 

67 IF SI""YES» THEN 70 

68 PRINT "INCORRECT ANSWER. PLEASE TYPE 'YES» OR «NO', w f 

69 GOTO 60 

70 PRINT " » 

72 PRINT "YOUR MOVE"! 

80INPUTJ1 

85 GOSUB 1800 

90 LETK1-INTCJ1/100) 

95 LET J2*CJ1-K1#100) 

96 LET K2»INTCJ2/10) 

97 LET K3« Jl - Kl*100 »K2#10 

98 LET M«16»Kl+4#K2+K3-20 

99 IF XCM)«0 THEN 109 

100 PRINT "THAT SQUARE IS USED, TRY AGAIN" 

101 GOTO 70 

109 LET X(M),«1 

110 GOSUB 1050 
180 FOR J«l TO 3 
190 FOR 1=1 TO 76 

200 IF Jsl THEN 210 

201 IF J«2 THEN 220 
203 IF J«3 THEN 235 

205 NEXT I 

206 NEXTJ 

207 GOTO 400 

210 IF LCI)<>4 THEN 205 

211 PRINT "YOU WIN AS FOLLOWS" I 

212 FOR J«l TO 4 

213 LET M»M(I,J> 

214 GOSUB 1000 

216 NEXT J 

217 GOTO 500 

220 IF LU)<>15 THEN 205 

221 FOR J«l TO 4 

222 LET M«M(I,J) 

223 IF XCM)<>0 THEN 227 

224 LET X(M)b5 

225 PRINT "MACHINE MOVES TO") 

226 GOSUB 1000 

227 NEXT J 

228 PRINT ", AND WINS AS FOLLOWS" 

229 FOR Jsl TO 4 

230 LET M*M(I,J) 

231 GOSUB 1000 

233 NEXT J 

234 GOTO 500 

235 IF LCI)<>3 THEN 205 

236 PRINT "NICE TRY MACHINE MOVES TO") 

237 FOR Jal TO 4 

238 LET M*M(I,J) 

239 IF X(M)<>0 THEN 245 

240 LET X(M)»5 

241 GOSUB 1000 
243 GOTO 70 
245 NEXT J 

248 GOTO 400 

250 FOR I b i TO 76 

251 LET L(I)"XCM(I,t))+XCM(I,2))+X(M(I,3))*X(M(I,4)) 

252 LET L ■ LCI) 

255 IF L <2 THEN 290 

260 IF L>»3 THEN 290 

265 IF L>2 THEN 1600 

270 FOR J ■ 1 TO 4 

275 IF XCM(I,J))<>0 THEN 285 

280 LET XCM(I,J))«l/8 

285 NEXT J 

290 NEXT I 

295 GOSUB 1050 

300 FOR I ■ I TO 76 

305 IF LCI)«t/2 THEN 1700 

310 IF LCD"l + 3/8 THEN 1700 

315 NEXI I 

320 GOTO 1300 

360LET Z « 1 

362 IF XCYCZ))"0 THEN 380 

365 LET Z"Z*t 

368 IF Z<>17 THEN 362 

375 GOTO 1200 

380 LET M«YCZ) 

381 LET XCM)«5 

385 PRINT "MACHINE MOVES TO"f 

389 GOSUB 1000 

390 GOTO 70 
400 LET X«X 

410 FOR I«l TO 76 

412 LET LCI)«XCMCI»1))+XCMCI,2))+X(M(I,3))+XCMCI,4)) 

415 LET L»L(I) 

420 IF L<10 THEN 455 

425 IF L>»11 THEN 455 

430 IF L>10 THEN 1600 

435 FOR J«l TO 4 

440 IF X(MCX»J))<>0 THEN 450 1 7 C 

445 LET XCM(I,JJ)«l/8 J- / v 



450 NEXT J 

455 NEXT I 

470 GOSUB 1050 

475 FOR I«l TO 76 

480 IF LCD". 5 THEN 1700 

485 IF LCI)"5+3/8 THEN 1700 

490 NEXI .1 

492 GOSUB 1800 

493 GOTO 250 
500 PRINT " " 

505 PRINT "DO YOU WANT TO TRY ANOTHER GAME") 
510 INPUT XS 

515 IF X$»"YES« THEN 35 

516 IF XS«"NO« THEN 520 

517 PRINT "INCORRECT ANSWER. PLEASE TYPE »YES» OR I NO • n f 

518 GOTO 510 
520 STOP 

1000 LET K1BINT(CM-1)/16)+1 

1010 LET J2BM«16#CKl»i) 

1030 LET K2BINTCCJ2"1)/4)*1 

1035 LET K3bm«<K1-1)*16-(K2-1)#4 

1040 LET M«Kl#100+K2#10+K3 

1042 PRINT M) 

1045 RETURN 

1050 FOR S»l TO 76 

1060 LET Jl b M(S,1) 

1070 LET J2bMCS,2) 

1080 LET J3a M CS,33 

1090 LET J4bMCS,4) 

1100 LET L(S)»X(Jt)*XCj2)*XtJ3)*X(j4) 

1110 NEXT S 

1120 RETURN 

1200 FOR IbI TO 64 

1210 IF XCI)<>0 THEN 1250 

1220 LET XCI)b5 

1225 LET MBI 

1226 PRINT "MACHINE LIKES") 

1227 GOSUB 1000 

1228 PRINT " " 
1230 GOTO 70 
1250 NEXT I 

1252 PRINT "THE GAME IS A DRAW" 

1255 GOTO 500 

1300 FOR KB1 TO 18 

1305 LET PB0 

1310 FOR Ib4#K-3 TO 4#K 

1315 FOR JBl TO 4 

1320 LET PbP+XCMCI,J)) 

1325 NEXT J 

1330 NEXT I 

1345 IF P<4 THEN 1390 

1350 IF P<5 THEN 1400 

1355 IF P<9 THEN 1390 

1360 IF P<10 THEN 1400 

1390 NEXT K 

1395 GOSUB 1800 

1396 GOTO 360 
1400 LET 3*1/8 

1405 FOR Ib4#K-3 TO 4#K 

1410 GOTO 1703 

1415 NEXT I 

1420 LET Sb0 

1425 GOTO 1405 

1500 DATA 1,49,52,4,13,61,64,16,22,39,23,38,26,42,27,43 

1510DATA 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 

1520 DATA 21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38 

1521 DATA 39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56 

1522 DATA 57*58,59,60,61,62,63,64 

1523DATA1, 17, 33, 49, 5, 2 1,37, 53, 9, 25, 41, 57, 13, 29, 45, 61 

1524 DATA 2,18,34,50,6,22,38,54,10,26,42,58,14,30,46,62 

1525DATA 3,19,35,51,7,23,39,55,11,27,43,59,15,31,47,63 

1527 DATA 4,20,36,52,8,24,40,56,12,28,44,60,16,32,48,64 

1529 DATA 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61 

1532 DATA 2,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62 

1534 DATA 3,7,11,15,19,23,27,31,35,39,43,47,51,55,59,63 

1536 DATA4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64 

1538 DATA1, 6, 11, 16, 17, 22, 27, 32, 33, 38, 43, 48, 49, 54, 59, 64 

1540 DATA 13,10,7,4,29,26,23,20,45,42,39,36,61,58,55,52 

1542 DATA1, 21, 41, 6 1,2, 22, 42, 62, 3, 23, 43, 6 3, 4, 24, 44, 64 

1544DATA 49,37,25,13,50,38,26,14,51,39,27,15,52,40,28,16 

1546DATA 1,18,35,52,5,22,39,56,9,26,43,60,13,30,47,64 

1548DATA 49,34,19,4,53,38,23,8,57,42,27,12,61,46,31,16 

1550DATA 1,22,43,64,16,27,38,49,4,23,42,61,13,26,39,52 

1600 FOR JbI TO 4 

1605 IF XCMCI,J)X>l/8 THEN 1650 

1610 LET XCMCI,J))bS 

1615 IF LCIX5 THEN 1625 

1620 PRINT "LET'S SEE YOU GET OUT OF THISi MACHINE MOVES TO") 

1622 GOTO 1626 

1625 PRINT "YOU FOX. JUST IN THE NICK OF TIME, MACHINE MOVES TO") 

1626 LET MbMCI,J) 
1630 GOSUB 1000 
1640 GOTO 70 
1650 NEXT J 

1660 PRINT "MACHINE CONCEDES THIS GAME." 

1665 GOTO 500 

1700 LET S*l/8 

1703 IF I«INTCI/4)#4>1 THEN 1715 

1705 LET AbI 

1710 GOTO 1720 

1715 LET Ab2 

1720 FOR J>A TO 5-A STEP 5»2#A 

1725 IF XCMCI,J))BS THEN 1750 

1730 NEXT J 

1735 GOTO 1415 

1750 LET X(M(I#J))«5 

1755 LET M«M(I,J) 

1760 PRINT "MACHINE TAKES") 

1770 GOSUB 1000 

1780 GOTO 70 

1800 FOR IbI TO 64 

1810 IF XCDOl/8 THEN 1850 

1815 LET XCI)b0 

1850 NEXT I 

1860 RETURN 

2000 END 



SAMPLE RUN 

QUBIC 15:lfi 



DO YOU WANT INSTRUCTIONS ?VES 

THE GAME IS TIC-T AC-TOE IN ft 4 X 4 X 4 CUBE. 

EfiCH HOVE IS INDICATED BV fl 2 DIGIT NUMBER, WITH EACH 

DIGIT BETWEEN 1 AND 4 INCLUSIVE. THE DIGITS INDICATE THE 

LEVEL, COLUMN, AND ROW, 'RESPECTIVELY OF THE OCCUPIED PLACE. 

DO VOU WANT TO MOVE FIRST ?VES 

VOUR MOVE ?222 

MACHINE MOVES TO 111 

VOUR MOVE ?211 

MACHINE MOVES TO 411 

VOUR MOVE ?222 

NICE TRV MACHINE MOVES TO 244 

VOUR MOVE ?122 

MACHINE MOVES TO 414 

VOUR MOVE ?422 

NICE TRV MACHINE MOVES TO 222 

VOUR MOVE ?121 

MACHINE MOVES TO 114 

VOUR MOVE ?323 

NICE TRV MACHINE MOVES TO 424 

VOUR MOVE ?413 

NICE TRV MACHINE MOVES TO 142 

VOUR MOVE ?444 

MACHINE MOVES TO 141 

VOUR MOVE ?142 

MACHINE TAKES 112 

VOUR MOVE ?112 

MACHINE TAKES 223 

VOUR MOVE ?141 

THAT SQUARE IS USED, TRV AGAIN 

VOUR MOVE 1*322 

MACHINE MOVES TO 441 

VOUR MOVE ?241 

LET'S SEE VOU GET OUT OF THIS: MACHINE MOVES TO 421 

VOUR MOVE ?431 

MACHINE MOVES TO 124 , AND WINS AS FOLLOWS 

421 322 223 124 
DO VOU WANT TO TRV ANOTHER GAME ?VES 
DO VOU WANT TO MOVE FIRST ?VES 

VOUR MOVE ?111 

MACHINE MOVES TO 411 

VOUR MOVE ?141 

MACHINE MOVES TO 414 

VOUR MOVE ?441 

MACHINE MOVES TO 114 

VOUR MOVE ?121 

NICE TRV MACHINE MOVES TO 121 

VOUR MOVE ?221 

NICE TRV MACHINE MOVES TO 321 

VOUR MOVE ?341 

NICE TRV MACHINE MOVES TO 241 

VOUR MOVE ?444 

MACHINE MOVES TO 144 

VOUR MOVE ?222 

NICE TRV MACHINE MOVES TO 222 

VOUR MOVE ?213 

MACHINE TAKES 222 

VOUR MOVE ?434 

LET'S SEE VOU GET OUT OF THIS; MACHINE MOVES TO 214 

VOUR MOVE ?314 

MACHINE MOVES TO 223 , AND WINS AS FOLLOWS 

241 232 223 214 
DO VOU WANT TO TRV ANOTHER GAME ?NO 



177 



QUEEN 



ONE CHESS QUEEN 



Description 



This game is based on the permissible moves of the chess queen — 
i.e., along any vertical, horizontal, or diagonal. In this game, 
the queen can only move to the left, down, and diagonally down 
to the left. 

The object of the game is to place the queen (one only) in the 
lower left-hand square (no. 150), by alternating moves between 
you and the computer. The one to place the queen there wins. 

You go first and place the queen in any one of the squares on 
the top row or the right-hand column. That is your first move. 
The computer is beatable, but it takes some figuring. See if 
you can devise a winning strategy. 

Source 

Source and author are totally unknown. 




^VVWVV* 



178 



PROGRAM LISTING 

1 REM PLAYS QUEEN GAME, 

2 PRINT "DO YOU WISH INSTRUCTIONS" I 

9 RANDOMIZE 

10 DIM 5(64) 

11 FOR I * i TO 64 

12 READ SCI) 

13 NEXT I 

14 DATA 81, 71, 61, 51, 41, 31, 21, 11 

15 DATA 92, 82, 72, 62, 52, 42, 32, 22 

16 DATA 103, 93, 83, 73, 63, 53, 43, 33 

17 DATA 114, 104, 94, 84, 74, 64, 54, 44 

18 DATA 125, 115, 105, 95, 85, 75, 65, 55 

19 DATA 136, 126, 116, 106, 96, 86, 76, 66 

20 DATA 147, 137, 127, 117, 107, 97, 87, 77 

21 DATA 158, 148, 138, 128, 118, 108, 98, 88 

22 INPUT W$ 

23 IF W$a"NO" THEN 30 

24 IF W$a"YES" THEN 28 

25 PRINT "INCORRECT ANSWER. PLEASE TYPE » YES I OR 

26 GOTO 22 

28 GOSUB 5000 

29 GO TO 100 

30 GOSUB 5150 

90 REM ERROR CHECKS, 

100 PRINT "WHERE WOULD YOU LIKE TO START" I 

110 INPUT Ml 

115 IF Ml ■ THEN 232 

120 LET Tl « INTCMl/10) 

130 LET Ul * Ml » 10*T1 

140 IF Ul * 1 THEN 200 

150 IF Ul a Tt THEN 200 

160 PRINT "PLEASE READ THE DIRECTIONS AGAIN," 

165 PRINT "YOU HAVE BEGUN ILLEGALLY," 

170 PRINT 

180 GO TO 100 

200 GO SUB 2000 

210 PRINT "MACHINE MOVES TO SQUARE»M 

215 IF M * 158 THEN 3400 

220 PRINT "WHAT IS YOUR MOVE"* 

230 INPUT Ml 

231 IF Ml <> THEN 239 

232 PRINT 

233 PRINT "IT LOOKS LIKE I HAVE WON BY FORFEIT," 

234 PRINT 

235 GO TO 4000 

239 IF Ml <= M THEN 3200 

240 LET Tl ■ INTCMl/10) 
250 LET Ul * Ml - 10*T1 
260 LET P * Ul - U 



158 THEN 3570 
127 THEN 3570 
126 THEN 3570 
75 THEN 3570 
7 3 THEN 3570 



I 270 


[F P <> THEN 300 


| 280 LET L » Ti - T 




i 290 


[F L <* THEN 3200 


295 GO TO 200 




300 


IF 11 ■ I <> P THEN 320 


310 GO TO 200 




1 320 


tF Tl - T <> 2*P 


THEN 3200 


330 < 


30 TO 200 




1990 


REM LOCATE MOVE 


FOR MACHINE, 


2000 


IF Ml, .9 41 THEN 


2180 


2010 


IF Ml ■ 44 THEN 


2180 


2020 


IF Ml ■ 73 THEN 


2180 


2030 


IF Ml a 75 THEN 


2180 


2040 


IF Ml 9 126 THEN 


2180 


2050 


IF Ml ■• 127 THEN 


2180 


2060 


IF Ml s 158 THEN 


3300 


2065 


LET C s 




2070 


FOR K a 7 TO 1 STEP *1 


2080 


LET U ■ Ul 




2090 


LET T a Tl + K 




2100 


GO SUB 3500 




2105 


IPC* 1 THEN 2160 


2110 


LET U a U + K 




2120 


GO SUB 3500 




2125 


IF C ■ 1 THEN 2160 


2130 


LET T a T + K 




2140 


GO SUB 3500 




2145 


IF C « 1 THEN 2160 


2150 


NEXT K 




2155 


GO TO 2180 




2160 


LET C * 




2170 


RETURN 




2180 


GO SUB 3000 




2190 


RETURN 




2990 


REM RANDOM MOVE, 




3000 


LET Z*RND 




3010 


IF Z > ,6 THEN 31H3 


3020 


IF Z > ,3 THEN 3070 


3030 


LET U * Ul 




3040 


LET T a Tl ♦. 1 




3050 


LET M a 10*T ♦ II 




3060 


RETURN 




3070 


LET U » Ul ■♦ 1 




3080 


LET T a it ♦ 2 




3090 


LET M a 10*T * U 




3100 


RETURN 




3110 


LET U a Ul + 1 




3120 


LET T a Tl + 1 




3130 


LET M « 10*T + U 




3140 


RETURN 




3190 


REM ILLEGAL MOVE 


MESSAGE, 


3200 


PRINT 




3210 


PRINT "YOU C 


HEAT, , 


3220 


GO TO 230 




3290 


REM PLAYER WINS, 




3300 


PRINT 




3310 


PRINT "CON G R 


A T U L A T 



TRY AGAIN"! 



ION S , , , " 
3320 PRINT 

3330 PRINT "YOU HAVE WOM--VERY WELL PLAYED," 
33.40 PRINT "IT LOOKS LIKE I HAVE MET MY MATCH," 
3350 PRINT "THANKS FOR PLAYING — I CAN'T WIN ALL THE TIME," 
3360 PRINT 
3370 GO TO 4000 
3390 REM MACHINE WINS, 
3400 PRINT 

3410 PRINT "NICE TRY, BUT IT LOOKS LIKE I HAVE WON," 
3420 PRINT "THANKS FOR PLAYING," 
3430 PRINT 
3440 GO TO 4000 

3490 REM TEST FOR MACHINE MOVE, 179 

3500 LET M a 10#T ♦ U 



3510 IF M 

3520 IF M 

3530 IF M 

3540 IF M 

3550 IF M 

3560 RETURN 

3570 LET C « 1 

3580 GO TO 3560 

3990 REM ANOTHER GAME? 

4000 PRINT "ANYONE ELSE CARE TO TRY"! 

4020 INPUT Q$ 

4030 PRINT 

4040 IF QS»»YES" THEN100 

4042 IF Q$b«NO« THEN 4050 

4045 PRINT "INCORRECT ANSWER, PLEASE TYPE »YES' OR » NO » " » 

4046 GOTO 4020 

4050 PRINT "OK - - THANKS AGAIN," 

4060 STOP 

4990 REM DIRECTIONS, ETC , , , 

5000 PRINT "WE ARE GOING TO PLAY A GAME BASED ON ONE OF THE CHESS MOVES," 

5010 PRINT "OUR QUEEN WILL BE ABLE TO MOVE ONLY TO THE LEFT," 

5020 PRINT "DOWN, AND DIAGONALLY DOWN TO THE LEFT," 

5030 PRINT 

5040 PRINT "THE OBJECT OF THE GAME IS TO PLACE THE QUEEN IN THE" 

5050 PRINT "LOWER LEFT-HAND SQUARE BY ALTERNATING MOVES BETWEEN" 

5060 PRINT "YOU AND THE MACHINE/ THE FIRST ONE TO PLACE THE QUEEN" 

5070 PRINT "THERE, WINS," 

5080 PRINT 

5090 PRINT "YOU GO FIRST AND PLACE THE QUEEN IN ANY ONE OF THE" 

5100 PRINT "SQUARES ON THE TOP ROW OR THE PIGHT'HAND COLUMN," 

5110 PRINT "THAT WILL BE YOUR FIRST MOVE," 

5120 PRINT "WE WILL THEN ALTERNATE MOVES," 

5130 PRINT "YOU MAY FORFEIT AT ANY TIME BY TYPING '0' AS YOUR MOVE," 

5140 PRINT "BE SURE TO PUSH THE 'RETURN' KEY AFTER EACH RESPONSE," 

5150 PRINT 

5160 FOR A a TO 7 

5170 FOR B a 1 TO 8 

5180 LET I a 8#A + B 

5190 PRINT 8(1)1 

5200 NEXT B 

5210 PRINT 

5220 PRINT 

5225 PRINT 

5230 NEXT A 

5240 PRINT 

5250 RETURN 

99999 END 

SAMPLE RUN 

DO VOU WISH INSTRUCTIONS ?VES 

WE ARE GOING TO PLRV ft GAME BASED ON ONE OF THE CHESS MOVES. 

OUR QUEEN WILL BE ABLE TO MOVE ONLV TO THE LEFT, 

DOWN, AND DlftGONftLLV DOWN TO THE LEFT. 

THE OBJECT OF THE GAME IS TO PLACE THE QUEEN IN THE 
LOWER LEFT-HAND SQUARE BV ALTERNATING MOVES BETWEEN 
VOU AND THE MACHINE/ THE FIRST ONE TO PLACE THE QUEEN 
THERE, WINS. 

VOU GO FIRST AND PLACE THE QUEEN IN ANV ONE OF THE 

SQUARES ON THE TOP ROW OR THE RIGHT-HAND COLUMN 

THAT WILL BE VOUR FIRST MOVE. 

WE WILL THEN ALTERNATE MOVES. 

VOU MAV FORFEIT AT ANV TIME BV TVPING ' ©'' AS VOUR MOVE 

BE SURE TO PUSH THE "RETURN' KEV AFTER EACH RESPONSE. 



81 71 61 51 41 31 



11 



92 82 72 62 52 42 22 22 

103 93 83 73 63 53 43 33 

114 104 94 84 74 64 54 44 

125 115 105 95 85 75 65 55 

136 126 116 1©6 96 86 76 66 

147 137 127 117 107 9? 87 77 

158 148 138 128 118 108 98 88 



WHERE WOULD VOU LIKE TO START ?81 
MACHINE MOVES TO SQUARE 158 

NICE TRV, BUT IT LOOKS LIKE I HAVE WON. 
THANKS FOR PL AVI NG. 

ANVONE ELSE CARE TO TRV ?VES 

WHERE WOULD VOU LIKE TO START ?158 
PLEASE READ THE DIRECTIONS AGAIN. 
VOU HAVE BEGUN ILLE6ALLV. 

WHERE WOULD VOU LIKE TO START ?44 
MACHINE MOVES TO SQUARE 55 
WHAT IS VOUR MOVE ?65 
MACHINE MOVES TO SQUARE 75 
WHAT IS VOUR MOVE ?86 
MACHINE MOVES TO SQUARE 126 
WHAT IS VOUR MOVE ?148 
MACHINE MOVES TO SQUARE 158 

NICE TRV, BUT IT LOOKS LIKE I HAVE WON. 
THANKS FOR PLAVING. 

ANVONE ELSE CARE TO TRV ?N0 

OK -..-■ THANKS AGAIN. 



REVRSE 



_ ORDER A LIST OF NUMBERS 

Description 

The game of REVERSE requires you to arrange a list of numbers 
in numerical order from left to right. To move, you tell the 
computer how many numbers (counting from the left) to reverse. 
For example, if the current list is: 

2 3 4 5 16 7 8 9 
and you reverse 4, the result will be: 

543216789 

Now if you reverse 5, you win! 

There are many ways to beat the game, but approaches tend to be 
either algorithmic or heuristic. The game thus offers the player 
a chance to play with these concepts in a practical (rather than 
theoretical) context. 

An algorithmic approach guarantees a solution in a predictable 
number of moves, given the number of items in the list. For 
example, one method guarantees a solution in 2N - 3 moves when 
the list contains N numbers. The essence of an algorithmic 
approach is that you know in advance what your next move will 
be. One could easily program a computer to do this. 

A heuristic approach takes advantage of "partial orderings" in 
the list at any moment. Using this type of approach, your next 
move is dependent on the way the list currently appears. This 
way of solving the problem does not guarantee a solution in a 
predictable number of moves, but if you are lucky and clever, 
you may come out ahead of the algorithmic solutions. One could 
not so easily program this method. 

In practice, many players adopt a "mixed" strategy, with both 
algorithmic and heuristic features. Is this better than either 
"pure " strategy? 

Program Author 

Bob Albrecht 
People's Computer Co. 
Menlo Park, CA 94025 



180 




A GAME OF SKILL "SPRINT 



PROGRAM LISTING 

108 PRINTSPRINT "REVERSE 

120 RANDOMISE 

130 DIM R<20> 

140 REM *** N=NUMBER OF NUMBERS 

150 N = 9 

160 INPUT "DO YOU WANT THE RULES <YES OR NO)'; ft* 

186 IF A*="NO" THEN £10 

190 GOSUB 710 

290 REM *** MAKE fl RANDOM LIST fl<l> TO A(N) 

218 fl < 1 > - 1 NT < < N-l > *RND ) +2 

220 FOR K=2 TO N 

239 R(K>=INT(N*RND)+1 

246 FOR J=l TO K-l 

250 IF A<K)=R(J) THEN 23© 

260 NEXT JSNEXT K 

280 REM *** PRINT ORIGNIAL LIST AND START GAME 

290 PRINTSPRINT "HERE WE GO ... THE LIST IS:" 

310 T=0 

320 GOSUB 610 

330 INPUT "HOW MANY SHALL I REVERSE"; R 

350 IF R=0 THEN 52© 

360 IF RON THEN 390 

370 PRINT "OOPS! TOO MANY - I CAN REVERSE AT MOST"NSGOTO 330 

390 T=T+1 

400 REM *** REVERSE R NUMBERS AND PRINT NEW LIST & 

FOR K = l TO INT(R/2) 

Z*FKK) 

FKIO=fl<R-K + l> 

fl<R-K+l>=Z 

NEXT K 

GOSUB 610 • 

REM *** CHECK FOR A WIN 

FOR K = l TO N 

IF R<K)OK THEN 330 

NEXT K 

PRINT "YOU WON IT IN"T"MOVES ».'! "SPRINT 

INPUT "TRY AGAIN < YES OR NO)"; A* 

IF ft*=»YES" THEN 210 

PRINTSPRINT "O.K. HOPE YOU HAD FUNI! "SGOTO 999' 

REM *** SUBROUTINE TO PRINT LIST 

PRINTSFOR K«l TO NSPRINT A(K);SNEXT K 

PRINTSPRINTSRETURN 

REM *** SUBROUTINE TO PRINT THE RULES 

PRINTSPRINT "THIS IS THE GAME OF -REVERSE-'. TO WIN, ALL YOU HAVE" 

PRINT "TO DO IS ARRANGE A LIST OF NUMBERS (1 THROUGH " N" > " 

PRINT "IN NUMERICAL ORDER FROM LEFT TO RIGHT. TO MOVE, YOU" 

PRINT "TELL ME HOW MANY NUMBERS < COUNTING FROM THE LEFT) TO" 

PRINT "REVERSE. FOR EXAMPLE, IF THE CURRENT LIST IS:" 

PRINTSPRINT "2 3 4 5 1 6 7 S 9" 

PRINTSPRINT "AND YOU REVERSE 4, 



410 
420 
439 
440 
450 
460 
478 
480 
490 

500 

510 

530 
550 
560 

600 

610 
650 

700 

710 
720 
730 



THE RESULT WILL BE: 



780 PRINTSPRINT "5 4 3 2 16 7 8 9" 

790 PRINTSPRINT "NOW, IF YOU REVERSE 5, YOU WIN!" 

SO© PRINTSPRINT "1 2 3 4 5 6 7 8 9"SPRINT 

810 PRINT "NO DOUBT YOU WILL LIKE THIS GAME OF SKILL, BUT" 

820 PRINT "IF YOU WANT TO QUIT, REVERSE O (ZERO). " SPRI NTSRETURN 

999 END 



SAMPLE RUN 



REVERSE -- fl GAME OF SKILL 

DO VOU WANT THE RULES (YES OR NO)? YES 

THIS IS THE GAME OF 'REVERSE". TO WIN, FILL YOU HAVE 
TO DO IS ARRANGE A LIST OF NUMBERS <1 THROUGH 9 ) 
IN NUMERICAL ORDER FROM LEFT TO RIGHT. TO MOVE, VOU 
TELL ME HOW MANY NUMBERS (COUNTING FROM THE LEFT) TO 
REVERSE. FOR EXAMPLE, IF THE CURRENT LIST IS: 

2345167 8 9 

AND YOU REVERSE 4, THE RESULT WILL BE: 

5432167 8 9 

NOW, IF VOU REVERSE 5, VOU WIN! 

1234567 8 9 

NO DOUBT VOU WILL LIKE THIS GAME OF SKILL, BUT 
IF VOU WANT TO QUIT, REVERSE (ZERO). 

HERE WE GO . . . THE LIST IS: 

7 9 4 6 3 18 5 2 
HOW MANY SHALL I REVERSE? 6 

1364978 5 2 

HOW MANV SHALL I REVERSE? 8 

5 8 7 9 4 6 3 12 

HOW MANV SHALL I REVERSE? 9 

2 13 6 4 9 7 8 5 

HOW MANV SHALL I REVERSE? 2 

12 3 6 4 9 7 8 5 

HOW MANV SHALL I REVERSE? 8 

8 7 9 4 6 3 2 15 
HOW MANV SHALL I REVERSE? 9 

51236497 8 



181 



HOW MANV SHALL I REVERSE? 4 

3 2 15 6 4 9 7 8 
HOW MANV SHALL I REVERSE? 6 

46512 3 978 
HOW MANY SHALL I REVERSE? 2 

6 4 5 12 3 9 7 8 
HOW MANY SHALL I REVERSE? 9 

8793 2 1546 
HOW MANV SHALL I REVERSE? 2 

7893 2 15 46 
HOW MANV SHALL I REVERSE? 9 

6 4 5 12 3 9 8 7 
HOW MANV SHALL I REVERSE? 3 

5 4 6 12 3 9 8 7 
HOW MANY SHALL I REVERSE? 2 

4 5 6 1 2 3 9 8 7 
HOW MANY SHALL I REVERSE? 6 

3 2 16 5 4 9 8 7 
HOW MANY SHALL I REVERSE? 3 

12 3 6 5 4 9 8 7 
HOW MANY SHALL I REVERSE? 6 

4 5 6 3 2 19 8 7 
HOW MANY SHALL I REVERSE? 3 

6 5 4 3 2 19 8 7 
HOW MANV SHALL I REVERSE? 9 

7 8 9 1 2 3 4 5 6 
HOW MANY SHALL I REVERSE? 3 

9 8 7 12 3 4 5 6 
HOW MANV SHALL I REVERSE? 9 

6 5 4 3 2 17 8 9 
HOW MANV SHALL I REVERSE? 6 

1 2 3 4 5 6 7 8 9 
YOU WON IT IN 22 MOVES !!! 
TRV AGAIN (YES OR NO)? YES 
HERE WE GO . . . THE LIST IS: 

9 8 6 17 3 2 4 5 
HOW MANY SHALL I REVERSE? 9 

5 4 2 3 7 16 8 9 
HOW MANV SHALL I REVERSE? 4 

3245716 8 9 
HOW MANV SHALL I REVERSE? 2 

2 3 4 5 7 1 6 8 9 
HOW MANY SHALL I REVERSE? 6 

17 5 4 3 2 6 8 9 
HOW MANV SHALL I REVERSE? 2 

7 15 4 3 2 6 8 9 
HOW MANY SHALL I REVERSE? 6 

2 3 4 5 1 7 6 8 9 
HOW MANY SHALL I REVERSE? 7 

6 7 15 4 3 2 8 9 
HOW MANV SHALL I REVERSE? 2 

7 6 15 4 3 2 8 9 
HOW MANV SHALL I REVERSE? 7 

2345167 89 
HOW MANY SHALL I REVERSE? 4 

5 4 3 2 16 7 8 9 
HOW MANY SHALL I REVERSE? 5 

12 3 4 5 6 7 8 9 
VOU WON IT IN 11 MOVES ! ! ! 



ROCKET 



.LAND AN APOLLO CAPSULE ON THE MOON 

Description 

ROCKET , known also as LUNAR, LEM, and APOLLO, is by far and away 
the single most popular computer game. It exists in versions 
that start you anywhere from 500 feet to 200 miles above the 
moon, or other planets, too. Some allow the control of directional 
stabilization rockets and/or the retro rocket. The three versions 
presented here appear to be the most popular of the many varia- 
tions. 

ROCKET. In this program, you set the burn rate of the retro 
rockets (pounds of fuel per second) every 10 seconds and attempt 
to achieve a soft landing on the moon. 200 lbs/s^c really puts 
the brakes on, and lbs/sec is free fall. Ignition occurs at 
8 lbs/sec, so do not use burn rates between 1 and 7 lbs/sec. 
To make the landing more of a challenge, but more closely ap- 
proximate the real Apollo LEM capsule, you should make the 
available fuel at the start (N) equal to 16,000 lbs, and the 
weight of the capsule (M) equal to 32,500 lbs in Statement 15. 

Some computers object to the series expansion calculations in 
Statements 91 and 94 (as you near the lunar surface, these 
numbers get very small) . If yours does, substitute the expanded 
form — for the expansion in Statement 91: 

-Q* (1+Q* (1/2+Q* (1/3+Q* (1/4+Q/5) ) ) ) 

You should be able to figure the other one out yourself . 

ROCKT1. In this version, you start 500 feet above the lunar 
surface and control the burn rate in 1-second bursts. Each unit 
of fuel slows your descent by 1 ft/sec. The maximum thrust of 
your engine is 30 ft/sec/sec. 

ROCKT2. This is the most comprehensive of the three versions 
and permits you to control the time interval of firing, the 
thrust, and the attitude angle. It also allows you to work in 
the metric or English system of measurement. The instructions 
in the program dialog are very complete, so you shouldn't have 
any trouble. 

In most versions of ROCKET, the temptation is to slow up too 
soon and then have no fuel left for the lower part of the 
journey. This, of course, is disasterous (as you will find out 
when you land your own capsule) I 



182 



Source 

To put all the conflicting stories to rest, we can say with 
confidence that ROCKET was originally written in FOCAL by a 
Lexington High School student back in the mid 60' s. 



ROCKET: 

Jim Storer 

Lexington High School 

Lexington, MA 02173 



ROCKT I.- 
Eric Peters 

Digital Equipment Corp, 
Maynard, MA 01754 



R0CKT2: 

William Labaree II 
621 Oakley Place 
Alexandria, VA 22302 




© 1958 by Editorial Projects, Inc. 



183 



ROCKET PROGRAM LISTING 

ROCKET EDUSVSTEM 30 

2 PRINT "THIS IS A COMPUTER SIMULATION OF AN APOLLO LUNAR" 

3 PRINT "LANDING CAPSULE, "SFRINTSPRINT 

4 PRINT "THE QN-BOARD COMPUTER HAS FAILED (IT WASN'T MADE BV" 

5 PRINT "DIGITAL) SO VOU HAVE TO LAND THE CAPSULE MANUALLY" 

6 PRINTSPRINT "SET BURN RATE OF RETRO ROCKETS TO ANY VALUE BETWEEN" 

7 PRINT "8 (FREE FALL) AND 200 (MAXIMUM BURN) POUNDS PER SECOND" 

8 PRINT "SET NEW BURN RATE EVERV 10 SECONDS. "SPRINT 

9 PRINT "CAPSULE WEIGHT 32,500 LBS; FUEL WEIGHT 16, 500 LBS" 
IB PRINTSPRINTSPRINT "GOOD LUCK ! ! ! " 

11 L = 

13 PRINTSPRINT "SEC", "MI + FT", "MPH", "LB FUEL".. "BURN RATE"SPRINT 

15 A*120SV=1SM=33000SN*16500SG*1E~3S2*1. 8 

21 PRINT L, INT(A); INT(5288*(A~INT(A))),3688*V,M~N,SINPUT KST«18 

31 IF M-N<. 001 THEN 41SIF T<. 001 THEN 21SS=TSIF M>~N+S*K THEN 35 

32 5*<M-N)/K 

35 GOSUB 91SIF I<*0 THEN 71SIF V<=0 THEN 38SIF J<0 THEN SI 

38 GOSUB 61\G0TQ 31 

41 PRINT "FUEL OUT RT"L"SEC"S5=(~V+SQR( V*V+2*A*G) )/GSV-V+G*SSL*L+S 

51 W=3600*VSPRINT"ON MOON AT"L"SEC •<• IMPACT VELOCITY" W "MPH" 

32 IF MM, 2 THEN 53SPRINT "PERFECT LANDING! (LUCKY) "SGOTO 95 

53 IF W>10 THEN 56SPRINT "GOOD LANDING (COULD BE BETTER) "SGOTO 95 

56 IF W>60 THEN 58 SPRINT "CRAFT DAMAGE YOU'RE STRANDED HERE UNTIL" 

57 PRINT "A RESCUE PARTY ARRIVES, HOPE VOU HAVE ENOUGH OXYGEN ! "SGOTO 95 

58 PRINT "SORRY, BUT THERE WERE NO SURVIVORS. ., VOU BLEW IT!" 

59 PRINT "IN FACT, YOU BLASTED A NEW LUNAR CRATER "W*. £777 "FT DEEP" 
68 GOTO 95 

61 L=?L + S\T=T»SSM'*M-S*KSA*ISV=.JSRETURN 

71 IF S<5E-3 THEN 51SD=V+SQR(V*V+2*A*(G~2*K/M) )SS»2*A/D 

73 GOSUB 91SG0SUB 61SQ0T0 71 

81 W=<l-M*G/<2*K))/2SS*M*V/(2*K*(W+SGR(W*W+V/2>>>+. 85SG0SUB 91 

83 IF I<*0 THEN 71SG0SUB 61SIF J>0 THEN 31SIF V>0 THEN 81SG0T0 31 

91 G«S*K/MSJ=V+G*S+2*(-e-G*Q/2r.ij-:</2^G-4/4-G-5/5) 

94 I=A-G*S*S/2-V*S+Z*S*(e/2+Q^2/6+C!- , -3/12+i5*-4/20+i>!-5/30)SRETURN 

95 PRINTSPRINTSPRINTSPRINT "TRV AGAIN??"SGOT0 6 
99 END 

SAMPLE RUN 

ROCKET EDUSVSTEM 30 

THIS IS A COMPUTER SIMULATION OF AN APOLLO LUNAR 
XANDING CAPSULE. 



THE GN-BQARD COMPUTER HAS FAILED (IT WASN'T MADE BY 
DIGITAL) SO VOU HAVE TO LAND THE CAPSULE MANUALLY 

SET BURN RATE OF RETRO ROCKETS TO ANY VALUE BETWEEN 
9 (FREE FALL) AND 200 (MAXIMUM BURN) POUNDS PER SECOND 
SET NEW BURN RATE EVERV 10 SECONDS. 

CAPSULE WEIGHT 32,500 LBS; FUEL WEIGHT 16, 500 LBS 



GOOD 


LUCK! ! ! 












SEC 




MI + FT 


MPH 


LB FUEL 


BURN RATE 







120 


3608 


16588 


?8 


10 




109 5015 


3636 


16508 


?0 


20 




99 


4223 


3672 


16580 


?0 


30 




89 


2903 


3788 


16588 


?0 


40 




79 


1055 


3744 


16588 


?0 


50 




68 


3959 


3788 


16580 


?0 


60 




58 


1855 


3816 


16508 


?8 


70 




47 


2903 


3852 


16588 


?200 


88 




37 


1883 


3482. 87 


14588 


?200 


90 




28 


1191 


3086. 7 


12588 


?200 


100 




28 


1251 


2659. 65 


18580 


?200 


110 




13 


2549 


2196. 94 


8500 


?288 


128 




8 


370 


1692. 63 


6500 


>200 


130 




4 


658 


1139. 13 


4580 


?208 


140 




1 


4203 


526. 598 


2500 


?100 


150 







4042 


212. 242 


1588 


?45 


160 







1863 


84, 1831 


1050 


?20 


170 







908 


45. 9129 


858 


?17 


180 







438 


IS. 187 


688 


?12 


198 







241 


8. 68632 


568 


?11 


200 







157 


2. 7691 


458 


?9 


210 







185 


4, 27836 


368 


?9. 5 


228 







46 


3. 65466 


265 


?9. 8 


230 







7 


1. 66462 


167 


?9. 3 


ON MOON AT 233.183 SEC - 


IMPACT VELOCITY 


1. 6842 MPH 




GOOD 


LANDING 


(COULD BE BETTER) 






TRY AGAIN? 1 ? 













184 



R0CKT1 PROGRAM LISTING 



SAMPLE RUN 



LIST 

RQCKT1 03:3? PM 08-MRY-73 
70 PRINT "LUNAR LAND I NO SIMULATION- 
S' PRINT • . — .- — — "SPRINT 

190 INPUT "DO VOU WANT INSTRUCTIONS (YES OR NO)VA* 

120 IF A** "NO" THEN 390 

160 PRINT 

200 PRINT "VOU ARE LANDING ON THE MOON AND HAVE TAKEN OVER MANUAL" 

210 PRINT "CONTROL 500 FEET ABOVE A GOOD LANDING SPOT. VOU HAVE A" 

220 PRINT "DQWNWRRD VELOCITY OF 50 FT/SEC. 120 UNITS OF FUEL REMAIN. 

225 PRINT 

230 PRINT 

240 PRINT 

250 PRINT 

260 PRINT 

270 PRINT 

280 PRINT 

230 PRINT 

310 PRINT 

320 PRINT 

330 PRINT 

340 PRINT 

350 PRINT 

360 PRINT 

370 PRINT 

380 PRINT 

390 PRINT 

410 PRINT 



<5> 



PLOT OF DISTANCE" 



"HERE ARE THE RULES THAT GOVERN YOUR SPACE VEHICLE:" 

"(1) AFTER EACH SECOND; THE HEIGHT, VELOCITY, AND REMAINING" 
FUEL WILL BE REPORTED. " 

"<2> AFTER THE REPORT, A ' ?' WILL BE TYPED. ENTER THE" 

NUMBER OF UNITS OF FUEL VOU WISH TO BURN DURING THE" 

t NEXT SECOND. EACH UNIT OF FUEL WILL SLOW YOUR DESCENT" 
BY 1 FT/SEC, " 

"<3> THE MAXIMUM THRUST OF YOUR ENGINE IS 30 FT/SEC/SEC OR" 
30 UNITS OF FUEL PER SECOND. " 

"<4> WHEN VOU CONTACT THE LUNAR SURFACE; YOUR DESCENT ENGINE" 
WILL AUTOMATICALLY CUT OFF AND YOU WILL BE GIVEN A" 
REPORT OF YOUR LANDING SPEED AND REMAINING FUEL. * 
IF YOU RUN OUT OF FUEL, THE '?' WILL NO LONGER APPEAR, " 
BUT YOU SECOND BY SECOND REPORT WILL CONTINUE UNTIL" 
YOU CONTACT THE LUNAR SURFACE. "SPRINT 

"BEGINNING LANDING PROCEDURE..... "SPRINT 

"G OOP L U C K ! ! !" 
420 PRINTSPRINT 

440 PRINT "SEC FEET SPEED FUEL 
450 PRINT 
455 T*0SH»500SV*50SF=120 

490 PRINT T^TAB<4>;H;TAB<12>.; Vj TAB<28>; F; TAB<29>; • I ".; TAB<H/12+29>; "*" 
590 INPUT B 
510 IF B<0 THEN 650 
520 IF B>30 THEN B-30 
530 IF B>F THEN B=P 
540 Vl=V-B+5 
560 F*FVB 
570 H-H-. 5*<V+V1) 
580 IF H<-0 THEN 67© 
598 T*T+1 
680 VsVl 

610 IF F>0 THEN 490 
615 IF B*8 THEN 640 
620 PRINT "*** OUT OF FUEL ***" 

640 PRINT T;TAB<4>;H.:TAB<12>; V; TAB<20>; F; TRB<29>; ■ I ".; TR8<H/12+29>; "*" 
650 Bs*@ 
^m GOTO 548 

670 PRINT "*** CONTACT ***" 
680 H*H+. 5*<V+V1> 
690 IP B*5 THEN 720 

708 D*<-*V*SGR<V*V+H*<18-2*B>>>/<5-B> 
710 GOTO 730 
720 P?H/V 
730 Vl*V+<5-6>*D 

760 PRINT "TOUCHDOWN AT "; T+p.: "SECONDS. « 
770 PRINT "LANDING VELOCITY - "; VI.; "FT/SEC" 
780 PRINT F; "UNITS OF FUEL REMAINING. " 
798 IF V1O0 THEN 810 
800 PRINT "CONGRATULATIONS!! A PERFECT LANDING!" 

805 PRINT "YOUR LICENSE WILL BE RENEWED LATER. • 

810 IF ABS<V1><2 THEN 840 

820 PRINT ****** SORRY, BUT VOU BLEW IT!!!!" 

830 PRINT "APPROPRIATE CONDOLENCES WILL BE SENT TO YOUR NEXT OF KIN. ■'■ 

840 PRINTSFRINTSPRINT 

850 INPUT "ANOTHER MISSION",- A* 

870 IF A$*"YES" THEN 398 

880 PRINTSPRINT "CONTROL OUT. "SPRINT 

999 END 

READY 



RUN 

R0CKT1 83:39 PM 08-MAY-73 

LUNAR LANDING SIMULATION 

DO VOU WANT INSTRUCTIONS (VES OR NO)? YES 

VOU ARE LANDING ON THE MOON AND HAVE TAKEN OVER MANUAL 
CONTROL 508 FEET ABOVE A GOOD LANDING SPOT. YOU HAVE A 
DOWNWARD VELOCITY OF 58 FT/SEC. 120 UNITS OF FUEL REMAIN. 

HERE ARE THE RULES THAT GOVERN YOUR SPACE VEHICLE: 
■<1> AFTER EACH SECOND, THE HEIGHT, VELOCITY, AND REMAINING 

FUEL WILL BE REPORTED. 
<2> AFTER THE REPORT, A ' ?•' WILL BE TYPED. ENTER THE 

NUMBER OF UNITS OF FUEL VOU WISH TO BURN DURING THE 

NEXT SECOND. EACH UNIT OF FUEL WILL SLOW YOUR DESCENT 

BV 1 FT/SEC 
<3> THE MAXIMUM THRUST OF YOUR ENGINE IS 20 FT/SEC/SEC OR 

38 UNITS OF FUEL PER SECOND. 
<4> WHEN VOU CONTACT THE LUNAR SURFACE, YOUR DESCENT ENGINE 

WILL AUTOMATICALLY CUT OFF AND VOU WILL BE GIVEN A 

REPORT OF YOUR LANDING SPEED AND REMAINING FUEL. 
<5> IF YOU RUN OUT OF FUEL, THE ' ?•' WILL NO LONGER APPEAR, 

BUT YOUR SECOND BV SECOND REPORT WILL CONTINUE UNTIL 

YOU CONTACT THE LUNAR SURFACE. 



BEGINNING LANDING PROCEDURE. 
GOOD LUCK!!! 



SEC 


FEET 


SPEED 


FUEL PLOT OF DISTANCE 




8 


580 


50 




120 I 




? 3 












1 


449 


52 




11? I 




? 3 












2 


396 


54 




114 I 




? 3 












3 


341 


56 




111 I 




? 3 












4 


284 


58 




108 I 


+ 


? 7 












5 


227 


56 




101 I * 




? 9 












6 


173 


52 




92 I * 




? 9 












•? 


123 


48 




83 I * 




? 8 












8 


76. 5 


45 




75 I * 




? 25 








v 




9 


41. 5 


25 




58 I * 




? 25 












19 


26. 5 


5 




25 I * 




? 25 












*** 


OUT OF FUEL *** 






11 


31. 5 


-15 




8 I * 




12 


44 


-16 




I * 




13 


51. 5 


-5 




I * 




14 


54 







I . * 




15 


51. 5 


5 




I ' * 




16 


44 


10 




8 I * 




1? 


31. 5 


15 




I * 




18 


14 


20 




I* 




*** 


CONTACT 


*** 








TOUCHDOWN AT 18. 6476 


SECONDS. 




LANDING VELOCITY 


* 22. 2279 FT/SEC 




8 UNITS OF 


FUEL 


REMAINING, 




***** SORRV 


BUT 


VOU 


BLEW IT! ! ! ! 




APPROPRIATE 


CONDOLENCES WILL BE SENT TO YOUR NEXT 


OF KIN 



ANOTHER MISSION? YES 
BEGINNING LANDING PROCEDURE. 



G 


D 


L 


U C K 


! 


! ! 




SEC 


FEET 




SPEED 




FUEL 


PLOT OF Dl 





508 




50 




128 




? 5 














1 


450 




50 




115 




? 5 














2 


400 




50 




110 




? 5 














3 


350 




59 




185 




? 5 














4 


380 




50 




180 




? 5 














5 


250 




50 




95 




? 5 














6 


200 




50 - 




90 




? 5 














? 


ISO 




50 




85 




? 5 














8 


100 




5@ 




88 


* 


? 5 














9 


50 




50 




75 


* 


? 38 














10 


12. 5 




25 




45 


* 


? 30 














*** 


CONTACT 


*** 








TOUCHDOWN 


AT 


11 SECONDS. 




LANDING VELOCITY * 8 


FT/SEC 




15 


UNITS 


OF 


FUEL 


REMAINING. 




CONGRATULATIONS! ! 




A PERFEC1 


r LANDING! 


VOUR 


LICENSE 


WILL 


BE 


RENEWED. . 


LATER. 



185 



R0CKT2 PROGRAM LISTING 

7 REM LUNAR1 IS A INTERACTIVE GAME THAT SIMULATES A LUNAR , 

8 REM LANDING SIMILAR TO THAT OF THE APOLLO PROGRAM. 

9 REM THERE IS ABSOLUTELY NO CHANCE INVOLVED. 
10 LET ZS="GO" 

15 LET 31=1 

20 LET M= 17.9.5 

25 LET Fl=5.25 

30 LET N=7.5 

35 LET R0 = 926 

40 LET V0=1.29 

45 LET T = 

50 LET H0 = 60 

55 LET R=R0+H0 

60 LET A=-3.425 

65 LET R1=0 

70 LET Al=8.8436JE-04 

75 LET R3=0 

80 LET A3=0 

85 LET M 1 = 7.45 

90 LET M0=M1 

95 LET 3=750 
100 LET T1=0 
105 LET F-0 ' 
110 LET P=0 
115 LET N=l 
120 LET M2 = 
125 LET S=0 
130 LET C=0 

135 IF Z$="YES" THEN 1150 
140 PRINT 

145 PRINT "LUNAR LANDING SIMULATION" 
150 PRINT 

155 PRINT "HAVE YOU FLOWN ON AN APOLLO/LEM MISSION BEFORE#"; 
160 PRINT "(YES OR NO)"; 
165 INPUT 0$ 

170 IF Q$="YES" THEN 190 
175 IF Q$="NO" THEN 205 

180 PRINT "JUST ANSWER THE QUESTION, PLEASE"; 
185 GOTO 160 
190 PRINT 

195 PRINT "ENTER MEASUREMENT OPTION NUMBER"; 
200. GOTO 225 
205 PRINT 

210 PRINT "WHICH SYSTEM OF MEASUREMENT DO YOU PREFER ?" 
215 PRINT " 1= METRIC 0= ENGLISH" 

220 PRINT "ENTER THE APPROPRIATE NUMBER"; 
225 INPUT K 
230 PRINT 

235 IF K=0 THEN 280 
240 IF K=l THEN 250 
245 GOTO 220 
250 LET Z=1852.8 
255 LET M$="METERS" 
260 LET G3=3.6 
265 LET N$=" KILOMETERS" 
270 LET G5=1300 
275 GOTO 305 
280 LET Z=6080 
285 LET M$="FEET" 
290 LET G3=,592 
295 LET N$=" N. MILES" 
300 LET G5=Z 
305 IF Bl=3 THEN 670 
31? IF QS = "YES" THEN 485 
315 PRINT 

3216 PRINT " YOU ARE ON A LUNAR LANDING MISSION. AS THE PILOT OF" 
325 PRINT "THE LUNAR EXCURSION MODULE, YOU WILL BE EXPECTED TO" 
332 PRINT "GIVE CERTAIN COMMANDS TO THE MODULE NAVIGATION SYSTEM." 

335 PRINT " THE ON BOARD COMPUTER WILL GIVE A RUNNING ACCOUNT" 
340 PRINT "OF INFORMATION NEEDED TO NAVIGATE THE SHIP." 
345 PRINT 
35 PRINT 

355 PRINT "THE ATTITUDE ANGLE CALLED FOR IS DESCRIBED AS FOLLOWS-" 
360 PRINT "+ OR -180 DEGREES IS DIRECTLY AWAY FROM THE MOON" 
365 PRINT "-90 DEGREES IS ON A TANGENT IN THE DIRECTION OF ORBIT" 
370 PRINT "90 DEGREES IS CN A TANGENT FROM THE DIRECTION OF ORBIT" 
375 PRINT "0 (ZERO) DEGREES IS DIRECTLY TOWARD THE MOON" 
380 PRINT 

385 PRINT TA3(30);"-180,180" 
390 PRINT TA3(34):"t" 
395 PRINT TA3(27);"-90 < -+- > 90" 
400 PRINT TAB (34);"!" 
4 35 PRINT TAB(34);"0" 

410 PRINT TA3(23);"« DIRECTION OF ORBIT «" 
415 PRINT 

420 PRINT TAB (27); "SURFACE OF MOON" 
425 PRINT 
430 PRINT 
435 PRINT "ALL ANGLES BETWEEN -180 AND 18 

440 PRINT 

445 PRINT "1 FUEL UNIT = 1 SEC. AT MAX. THRUST" 

450 PRINT "ANY DISCREPANCIES ARE ACCOUNTED FOR IN THE USE OF FUEL" 
4^5 PRINT "FOR AN ATTITUDE CHANGE." 
460 PRINT "AVAILABLE ENGINE POWER: (ZERO) AND ANY VALUE BETWEEN" 

465 PRINT "10 AND 100 PERCENT" 

4 70 PRINT 

475 PRINT "NEGATIVE THRUST OR TIME IS PROHIBITED" 

480 PRINT 

485 PRINT 

490 PRINT "INPUT 

495 PRINT " 

5 00 PRINT " 
505 PRINT 

5 10 IF Q$="YES" THEN 535. 
5 15 PRINT "FOR EXAMPLE:" 
520 PRINT "T,P, A? 10,65,-60" 

525 PRINT "TO ABORT THE MISSION AT ANY TIME, ENTER 0,0,0" 
530 PRINT 

"OUTPUT: TOTAL TIME ELAPSED IN SECONDS" 
HEIGHT IN ";M$ 

DISTANCE FROM LANDING SITE IN ";M$ 
VERTICAL VELOCITY IN ";MS; "/SECOND" 
HORIZONTAL VELOCITY IN ";M$; "/SECOND" 
FUEL UNITS REMAINING" 



DEGREES ARE ACCEPTED. 



TIME INTERVAL IN SECONDS (T)" 

PERCENTAGE OF THRUST (P)" 

ATTITUDE ANGLE IN DEGREES (A)" 



535 PRINT 

5 40 PRINT " 

5 45 PRINT " 

550 PRINT " 

555 PRINT " 

5 60 PRINT " 

5 65 PRINT 

570 GOTO 670 

5 75 PRINT 

5 80 PRINT "T,P, A"; 

585 INPUT T1,F,P 

5 90 LET F=F/100 

595 IF T1<0 THEN 905 

600 IF Ti = THEN 1090 



605 IF ABS(F-.05)>1 THEN 945 

610 IF A3S(F-.05)<.05 THEN 945 

615 IF ABS(P)>180 THEN 925 

620 LET N=20 *;■ 

625 IF Tl<400 THEN 635 

630 LET N=Tl/20 

635 LET T1=T1/N 

640 LET P=P*3. 14159/180 

645 LET S=SIN(P) 

650 LET C=COS(P) 

655 LET M2=M0*T1*F/B 

660 LET R3=-.5*R0*((V0/R)T2)+R*A1*A1 

665 LET A3=-2*R1*A1/R 

670 FOR 1=1 TO N.. '■•■'.■■ . 

675 IF Mi=0 THEN 715 

680 LET MT-M1-M2 

685 IF M1>0 THEN 725 

690 LET F=F*(1+M1/M2) 

695 LET M2=M1+M2 

700 PRINT "YOU ARE OUT OF FUEL" 

705 LET M1=0 

710 GOTO 725 

7 15 LET F = 

720 LET M2 = 

725 LET M=M-.5*M2 

730 LET R4=R3 

735 LET R3=-.5*R0*((V0/R)?2)+R*A1*A1 

740 LET R2=(3*R3-R4)/2+.0(?526*Fl*F*C/M 

745 LET A4 = A3 

750 LET A3=-2*R1*A1/R 

755 LET A2=(3*A3-A/<)/2+.30526*Fl*F*S/(M*R) 

760 LET X=R1*T1+.5*R2*T1*T1 

765 LET R=R+X 

770 LET H0=H0+X 

775 LET R1=R1+R2*T1 

780 LET A= UAT*T1 + .5*A2*T1*T1 

785 LET A1=A1+A2*T1 

790 LET M=M-.5*M2 

795 LET T=T+TT 

800 IF H0<3. 28782SE-04 THEN 813 

825 NEXT I 

810 LET H=H0*Z 

815 LET H1=R1*Z 

820 LET D=R0*A*Z 

825 LET D1 = R*A1*Z 

830 LET T2=M1*B/M.0 

835 PRINT TAB(1);T;TAB(10);H;TAB(23);D; 

843 PRINT TAB(37);H1;TAB(49);D1;TA3(60);T2 

845 IF H0<3.28782SE-24 THEN 883 

S5E IF R0*A>164.4736 THEN 1050 

855 IF M1>0 THEN 580 

860 LET Tl = 20 

LET F=0 

LET P=0 

GOTO 623 

I.F Rl<-8.2l957E-04 THEN 1020 

IF ABS(R*Al)>4.931742E-04 THEN 1020 

IF H0<-3. 287828E-34 THEN 1020 

IF ABS(D)>10*Z THEN 1065 

GOTO 995 

PRINT 

PRINT "THIS SPACECRAFT IS NOT ABLE TO VIOLATE THE SPACE-"; 

PRINT "TIME CONTINUUM" 

GOTO 5 75 

PRINT 

PRINT "IF YOU WANT TO SPIN AROUND, GO OUTSIDE THE MODULE"; 

PRINT "FOR AN E.V.A" 

GOTO 575 

PRINT 

PRINT "IMPOSSIBLE THRUST- VALUE "; 

IF F<0 THEN 985 

IF F-.05<.05 THEN 975 

PRINT "TOO LARGE" 

GOTO 5 75 

PRINT "TOO SMALL" 

GOTO 575 - 

PRINT "NEGATIVE" 

GOTO 575 

PRINT 

PRINT "TRANQUILITY BASE HERE -- THE EAGLE HAS LANDED" 

PRINT "CONGRATULATIONS - THERE WAS NO SPACECRAFT DAMAGE" 

PRINT "YOU MAY NOW PROCEED WITH SURFACE EXPLORATION." 

GOTO 1100 

PRINT 

PRINT "CRASH !!! ! ! ! ! ! ! !" 

PRINT "YOUR IMPACT CREATED A CRATER" ;ABS (H) ;M$; " DEEP" 

X1=SQR(D1*D1+H1*H1)*G3 

PRINT "AT CONTACT YOU WERE TRAVELLI NG"; XI ;N$; "/HR ." 

GOTO 1100 

PRINT 

PRINT "YOU HAVE BEEN LOST IN SPACE WITH NO HOPE OF RECOVERY" 

GOTO 1100 

PRINT "YOU ARE DOWN SAFELY - " 

PRINT 

PRINT "BUT MISSED THE LANDING SITE BY"; ABS(D/G5 ); N$ 

GOTO 1100 

PRINT 

PRINT "MISSION ABORTED" 

PRINT 

PRINT "DO YOU WANT TO FLY IT AGAIN ? (YES OR NO)"; 

INPUT ZS 

IF Z$="YES" THEN 23 

IF Z$="NO" THEN 1130 

GOTO 1105 

PR I NT 

TOO BAD, THE SPACE PROGRAM HATES TO LOSE EXPERIENCED"; 
ASTRONAUTS." 



186 



870 
875 
880 
885 
890 
895 
900 
935 
910 
915 
920 
925 
930 
935 
940 
945 
950 
955 
960 
965 
970 
975 
980 
985 
993 
995 
1030 
1005 
1010 
1015 
1020 
1025 
1032 
1035 
1040 
1045 
1050 
1055 
1063 
1065 
1075 
1080 
1385 
1090 
1095 
1100 
1105 
1110 
1115 
1120 
1 1 25 
1130 
1135 
1140 
1145 
1150 
1155 
1 1 60 
1165 
1170 
1175 
1180 
1185 
1190 
1195 
1200 
1205 
1213 
1215 



PRINT 

PRINT 

STOP 

PRINT 

PRINT "OK, DO YOU WANT THE COMPLETE INSTRUCTIONS OR THE INPUT- 
PRINT "OUTPUT STATEMENTS ?" 
PRINT' "1 = COMPLETE INSTRUCTIONS" 
PRINT "2=INPUT-0UTPUT STATEMENTS" 
PRINT "3= NEITHER" 
INPUT Bl 
LET QS="NO" 
IF 81=1 THEN 205 
LET Q$="YES" 
IF 31=2 THEN 190 
IF Bl=3 THEN 190 
GOTO 1165 
END 



R0CKT2 SAMPLE RUN 



LUNAR LANDING SIMULATION 

HAVE YOU FLOWN ON AN APOLLO/LEM MISSION 3EF0RE# (YES OR NO)? NO 

WHICH SYSTEM OF MEASUREMENT -DO YOU PREFER ? 

1=METRIC 0= ENGLISH 
ENTER THE APPROPRIATE NUMBER? 



YOU ARE ON A LUNAR LANDING MISSION. AS THE PILOT OF 
THE LUNAR EXCURSION MODULE, YOU WILL BE EXPECTED TO 
GIVE CERTAIN COMMANDS TO THE MODULE NAVIGATION SYSTEM. 

THE ON BOARD COMPUTER WILL GIVE A RUNNING ACCOUNT " 
OF INFORMATION NEEDED TO NAVIGATE THE SHIP. 



THE ATTITUDE ANGLE CALLED FOR IS DESCRIBED AS FOLLOWS- 
+ OR -180 DEGREES IS DIRECTLY AWAY FROM THE MOON 
-90 DEGREES IS ON A TANGENT IN THE DIRECTION OF ORBIT 
90 DEGREES IS ON A TANGENT FROM THE DIRECTION OF ORBIT 
(ZERO) DEGREES IS DIRECTLY TOWARD THE MOON 

-180,130 

t 

-90 < -+- > 90 

! 



« DIRECTION OF ORBIT << 
SURFACE OF MOON 



ALL ANGLES 3ETW 



EN 



-180 AND 180 DEGREES ARE ACCEPTED. 



1 FUEL UNIT = 1 SEC. AT MAX. THRUST 

ANY DISCREPANCIES ARE ACCOUNTED FOR IN THE USE OF FUEL 

FOR AN ATTITUDE CHANGE. 

AVAILABLE ENGINE POWER: (ZERO) AND ANY VALUE BETWEEN 

10 AND 100 PERCENT 

NEGATIVE THRUST OR TIME IS PROHIBITED 



INPUT: TIME INTERVAL IN SECONDS (T ) 

PERCENTAGE OF THRUST (P) 

ATTITUDE ANGLE IN DEGREES (A) 



FOR EXAMPLE: 

T,P,A?10,65,-60 

TO ABORT THE MISSION AT ANY TIME 



ENTER 0,0, 



TOTAL TIME ELAPSED) IN SECONDS 
HEIGHT IN FEET 

DISTANCE FROM LANDING SITE IN FEET 
VERTICAL VELOCITY IN FEET/SECOND 
HORIZONTAL VELOCITY IN FEET/SECOND 
FUEL UNITS REMAINING 



364800 


-1.928302E+7 





5301.638 


75 




T,P,A? 20,20,-90 












20 364769.7 


-1.918380E+7 


-3.257229 


5264.209 


746 


.0001 


T ,P,A? 203, 13,-90 












220 358044.1 


- 1.821 20 3E+7 


-74.76607 


5 081.405 


726 


.0002 


T ,P,A? 500, 10,-90 












720 224322.9 


-1.589872E+7 


-522.345 1 


4709.512 


676 


.0002 


T,P,A? 5 00,0,0 












1040 -6773. 7 


-1.4395 53E+7 


-918.728 


4902.473 


676 


.0002 



CRASH !!!!!!!!!! 

YOUR IMPACT CREATED A CRATER S773.7 FEET DEEP 

AT CONTACT YOU WERE TRAVELLING 2952.787 N.MIL/HR. 



DO YOU WANT TO FLY IT AGAIN ? (YES OR NO)? YES 

OK, DO YOU WANT THE COMPLETE INSTRUCTIONS OR THE INPUT- 
OUTPUT STATEMENTS ? 
l=COMPLETE INSTRUCTIONS 
2- INPUT-OUTPUT STATEMENTS , 
■3= NEITHER 
? 3 

ENTER MEASUREMENT OPTION NUMBER? 1 

-5.87624SE+6 



111168 
T,P,A? 500,0,0 

500 106291.7 

T,P,A? 100,0,0 

600 134194.1 
T,P,A? 50,90,-90 

65 102921.8 
T,P,A? 100,0,<-<-20,0 
75 121574.9 
T,P,A? 50,90,-90 

800 101326.7 
T,P,A? 100,40,-090 

902 97203. S2 
T,P,A? 50,10,0 

950 93262.42 
T,P,A? 50,100,0 

1000 92036.68 
T,P,A? 50,100,-90 

1050 93087.58 
T,P,A? 50, 100,-90 
1100 92008.52 
T,P,A? 50,100,-90 

115 88333.39 
T,P,A? 100,100,-90 

1250 71627.24 

T,P,A? 50,100,0 
1300 62820.57 

T,P,A? 50,100,0 
135 60235.55 

T,P, A? 100,5 0,0 

1450 64599.96 

T,P,A? 100,40,-90 

1550 64756.08 

T,P,A? 50,50,-90 

1600 59156.86 

T,P,A? 10,0,0 

1610 5 75 73.89 

T,P,A? 10,100,0 
1620 56062.7 

T,P,A? 10,100,-90 

1630 54623.65 

T,P, A? 10,100,-90 

1640 5 3028.37 

T,P, A? 10,0,0 

1650 51276.44 

T,P,A? 30,0,0 
1680 45077.51 

T,P,A? 30,0,0 

1710 37455.8 

T,P,A? 50,0,3 
1760 21556.4 

T,P,A? 10,130,0 . 
1770 18125.25 

T,P,A? 30,0,0 

1800 7553.268 

T,P,A? 10,50,0 

1810 3817.706 

T,P, A? 5,100 «-,0 
1815 2005.734 

T,P,A? 5,100,0 

1820 270.6975 

T,P,A? 1,100,0 
1820.8 .2621521 

CRASH !!!!!!!!!! 

YOUR IMPACT CREATED 




-19.20258 
-22.72435 
-30.02382 

3.206664 
-14.90814 
-70.50644 



-5. 116247E+6 
-4.9635 36E+6 
-4.890089E+6 
-4.749094E+6 
-4.681730E+6 
-4.~8928E+6 

-4.5 301^2E+6 -87.14224 
-4.441 169E+5 38.9189 
-4.386076E+6 1.363938 

-4.338861E+6 -46.0884 

-4.299676E+6 -102.2833 

-4.246314E+6 -236.0606 

-4.228179E+6 -115.1086 
-4.209927E+S 12.985 13 
-4.1734^7E+6 75.8418 

-4. 145499E+6 -73.66691 

-4.138397E+6 -150.5384 

-4.137M5E+6 -166.0619 

-4.136631E+6 -136.1128 

-4.135 968F+6 -151.7089 

-4.1357=. 1E+6 -167.3554 

-4.1357=9E+6 -183.0355 

-4. 135 780E+6 -230.2823 

-4.13-802E+6 -277.9013 

-4.13-839E+6 -35 8.3198 

-4.13~846E+6 -327.851 

-4.135869E+6 -377.0488 

-4.135876E+6 -370.0578 

-4.13S880E+6 -354.7163 

-4. 135884E+6 -339.2829 

-4.13~885E+6 -336.805 



1615.604 

1619.915 

1621.782 

14 92.978 

1494.091 

1359.475 

1239.533 

1242.232 

1243.085 

1079,071 

910.9774 

738.2616 

375.7879 

377.652 

378.2053 

377.2816 

202.8112 

91.24105 

91.32249 

91.40043 

45.55091 

-.746715 

-.7474552 

-.75 00852 

-.7533445 

-.7602341 

-.761739 

-.7664103 

-.7680755 

-.768885 8 

-.7696634 

-.7697848 



750 

75 

75 

705.0001 

685.0002 

640.0003 

600.0003 

595.0004 

545.0004 

495.0004 

445.0004 

395.0005 

295.0005 

245.0005 

195.0005 

145.0006 

105.0006 

80.0006 

80.0006 

70.00061 

60.00062 

50.00063 

50.00063 

50.00063 

50.00063 

50.00063 

40.00063 

40.00063 

35.00064 

30.00064 

25.00065 

24.20065 



CRATER .2621521 METERS DEEP 



AT CONTACT YOU WERE TRAVELLING 12 12.501 KILOM/HR. 

DO YOU WANT TO FLY IT AGAIN ? (YES OR NO)? NO«-«-«-NO 

TOO BAD, THE SPACE PROGRAM HATES TO LOSE EXPERIENCED ASTRONAUTS. 



READY 



187 



ROCKSP 



GAME OF ROCK, SCISSORS, PAPER 



Description 

Remember the game of rock-scissors-paper. You and your opponent 
make a motion three times with your fists and then either show 
a flat hand (paper), fist (rock), or two fingers (scissors)* 
Depending upon what is shown, the game is a tie (both show the 
same) or one person wins. Paper wraps up rock, so it wins. 
Scissors cut paper, so it wins. And rock breaks scissors, 
so it wins . 

In this computerized version of rock-scissors-paper, you can 
play up to ten games vs. the computer. 

Program Author 



Charles Lund 

The American School 

Hague , Netherlands 



LIST 

ROCKSP 05:06 PM 03-MAY-72 

1 PRINT "THIS PROGRAM ALLOWS YOU TO PLAY THE OLD GAME OF* 

2 PRINT "ROCKS, PAPER, AND SISSORS AGAINST THE COMPUTER " 
.5 RANDOMIZE 

6 INPUT "HOW MANY GAMES DO YOU WANT H ;G' 

8 IF G<11 THEN 11 

9 PRINT "SORRY, BUT WE AREN'T ALLOWED TO PLAY THAT MANY. ■ 
11 FOR G=l TO C 

15 PRINTSPRINT "GAME NUMBER'G 

20 X=INT<RND*3+1> 

25 PRINT "3=R0CK. . . 2-SISSORS. . . 1 = PAPER«" 

36 INPUT "1. . . . 2. . . . 2, . :. WHAT'S YOUR CHOICE"; K 

32 IF <K»i>*<K-2>*<K-2K>e THEN PRINT ' INVAL ID'SGOTO 25 

35 PRINT "THIS IS MY CHOICE. . . " 

40 ON X GOTO 50, 60, 70 

50 PRINT "... PAPER "\G0T0 80 

60 PRINT "... SISSORS" \G0TO 80 

70 PRINT ". . .ROCK" 

80 IF X=K THEN 155 

85 IF X>K THEN 125 

90 IF X=l THEN 105 

95 PRINT "YOU WIN ! i ! " SH*H + 1SG0T0 16* 

105 IF K = 3 THEN 115 ELSE GOTO 95 

115 PRINT "WOW! I WIN! ! "SOC + 1S60T0 ISA 

125 IF KOI THEN 115 

140 IF X03 THEN 115 ELSE 95 

155 PRINT "TIE GAME, NO WINNER. " 

160 NEXT G 

170 PRINTSPRINT "HERE IS THE FINAL SCORE." 

175 PRINT "I HAVE WON "C "GAME (S >, " 

180 PRINT "YOU HAVE WON "H" GAME <S ). M 

185 PRINT "AND"G-(C+H>"GAME<S> ENDED IN A TIE ■ 

198 PRINTSPRINT "THANKS FOR PLAYING'!" 

200 END 

READV 





THIS PROGRAM ALLOWS YOU TO PLAY THE OLD GAME OF 
ROCKS, PAPER, AND SISSORS AGAINST THE COMPUTER 
HOW MANY GAMES DO YOU WANT? 20 

SORRY, BUT WE AREN'T ALLOWED TO PLAY THAT MANY 
HOW MANY GAMES DO YOU WANT? 10 

GAME NUMBER 1 

3=R0CK. . . 2=SISS0RS. . . 1 = PAPER 

1 2. . . . 3. . . . WHAT'S YOUR CHOICE? 1 

THIS IS MY CHOICE. . . 

. . . PAPER 

TIE GAME, NO WINNER. 

GAME NUMBER 2 

3 = R0CK. . . 2=SISS0RS. . . 1=PAPER 

1. ... 2. ... 3. .. . WHAT'S YOUR CHOICE'" & 

THIS IS MY CHOICE. . . 

. . . ROCK 

WOW! I WIN! ! 

GAME NUMBER 3 

3=ROCK. . . 2*SISS0RS. . . 1=PAPER 

1. ... 2. ... 3. .. . WHAT'S YOUR CHOICE' 1 "* 

THIS IS MY CHOICE. . . 

. . . SISSORS 

YOU WIN! ! ! 

GAME NUMBER 4 

3=R0CK. . . 2=SISS0RS. . . 1=PAPER 

1 . . • . 2. . . . 3, . . . WHAT'S YOUR CHO»' 

THIS IS MY CHOICE. . . 

. . . SISSORS 

WOM! I WIN! ! 

GAME NUMBER 5 
3=R0CK. . . 2SSI 1 " 

1 2. . . . * -rtOICE? 1 

THIS IS ' 
. . . RP r 
WO»' 



-SISSORS. . . 1 = PAPER 
. . 3. . . . WHAT'S YOUR CHOICE? 2 
iS MY CHOICE. . . 
. PAPER 
VOU WIN! ! ! 

GAME NUMBER 9 

3=R0CK. . . 2=SISS0RS. . . 1=PAPER 

1. . . . 2. . . . 3. . . . WHAT'S YOUR CHOICE? 3 

THIS IS MY CHOICE. . . 

. . . SISSORS 

YOU WIN! ! ! 

GAME NUMBER 10 

3=R0CK. . . 2=SISS0RS. . . 1=PAPER 

1. ... 2. ... 3. .. . WHAT'S YOUR CHOICE? 1 

THIS IS MY CHOICE. . . 

. . . SISSORS 

MOM! I WIN! ! 

HERE IS THE FINAL SCORE: 

I HAVE WON 5 GAMECS). 

VOU HAVE WON 3 GAME(S). 

AND 2 GAMECS) ENDED IN A TIE. 

THANKS FOR PLAYING! ! 

READY 



188 



ROULET 



EUROPEAN ROULETTE TABLE 



Description 



This game simulates a European Roulette wheel; "European" because 
it has 37 number compartments (1 to 36 and 0) • The American 
wheel has 38 numbers (1 to 36, and 00). The Bahamas, Puerto 
Rico, and South American countries are slowly switching to the 
American wheel because it gives the house a bigger percentage. 
Odd and even numbers alternate around the wheel, as do red and 
black. The layout of the wheel insures a highly random number 
pattern. In fact, roulette wheels are sometimes used to generate 
tables of random numbers. 

In this game, you may bet from $1 to $10,000 and you may bet on 
red or black, odd or even, a column, or single number. 

There is no long-range winning strategy for playing roulette. 
However, a good strategy is that of "doubling." First spin, 
bet $1 on an even/odds bet (odd, even, red, or black). If you 
lose, double your bet to $2. If you lose again, double to $4. 
Continue to double until you win (i.e., you break even on a 
losing sequence). As soon as you win, bet $1 again, and after 
every win, bet $1. Do not ever bet more than $1 unless you are 
recuperating losses by doubling. Do not ever bet anything but 
the even odds bets. Good luck I 

Source 

Like so many other games of chance, computerized ROULET has been 
around a long time in FORTRAN, LISP, and so on. Its original 
author is unknown today. 




189 



PROGRAM LISTING 



1010 
1020 
1030 
1040 
1050 
1060 
1070 
1080 
1090 
1100 
1110 
1120 
1130 
1140 
1150 
1160 
1170 
1180 
1190 
1200 
1210 
1220 
1230 
1240 
1250 
1260 
1270 
1280 
1290 
1300 
1310 
1320 
1330 
1340 
1350 
1360 
1370 
1375 
1380 
1390 
1400 
1410 
1420 
1430 
1440 
1450 
1460 
1470 
1480 
1490 
1500 
1510 
1520 
1530 
1540 
1550 
1560 
1570 
1580 
1590 
1600 
1610 
1620 
1630 
1640 
1650 
1660 
1670 
1680 
1690 
1700 
1710 
1720 
1730 
1740 
1750 
1760 
1800 
1810 
1820 
1830 
1840 
1850 
I860 
1870 
1880 
1890 
1900 
1910 
1920 
1930 
1940 
1950 
1960 
1970 
1980 
1990 
2000 
2010 
2020 
2030 
2040 
2050 
2060 
2070 
2080 
2090 
2100 
2110 
2120 
2130 
2140 
2150 
2160 
2170 
2180 
2190 
2200 
2210 
2220 



TYPE RUN TO PLAY THE GAME, 



WELCOME TO MONTE CARLO AND OUR EUROPEAN ROULETTE TABLE, 
I WISH YOU THE BEST OF LUCK," 



REM 

LET Kl 

PRINT » 

PRINT » 

PRINT 

PRINT 

PRINT "DO YOU WANT INSTRUCTIONS" ! 

INPUT Z8 

IF ZS a "NO" THEN 1800 

IF Z$ a "YES" THEN 1130 

GOSUB 2790 

GO TO 1070 

PRINT " THIS IS A GAME OF ROULETTE, YOU ARE ALLOWED TO BET" 

PRINT "AN ODD OR EVEN NUMBER AND/OR A BLACK OR RED NUMBER AND/OR" 

PRINT "A COLUMN OF NUMBERS AND/OR A NUMBER ITSELF, NUMBERS RANGE" 

PRINT "FROM TO 36, IF APPEARS, THE BANK COLLECTS ALL BETS" 

PRINT "EXCEPT THOSE BET ON THE NUMBER 0. THE PAYOFFS ARE AS FOLLOWS" 

PRINT, "ODD OR EVEN a 1 TO 1" 

PRINT, "RED OR BLACK » 1 TO 1 " 

PRINT, "A COLUMN a 2 TO 1" 

PRINT, "A NUMBER a 35 TO 1" 

PRINT » YOU ARE ALLOWED TO BET FROM SI TO 810000, BUT THE"? 

PRINT " TABLE WILL ONLY ACCEPT BET5 OF WHOLE DOLLARS (NO CENTS) , " 

PRINT 

PRINT " WOULD YOU LIKE TO SEE A PICTURE OF THE GAMBLING TABLE" J 

INPUT Z1S 

IF Z1S * "NO" THEN 1800 

IF Z1S a "YES" THEN 1320 

GOSUB 2790 

GO TO 1250 

PRINT 

PRINT 

PRINT" 

PRINT 

PRINT 

PRINT, " ###########" 

PRINT, 

LET US 

PRINT, U 

PRINT," 

PRINT," 

PRINT 

PRINT," 

PRINT," 

PRINT, l 

PRINT*" 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT 

PRINT," 

PRINT," 

PRINT, U 

PRINT," 

PRINT," 

PRINT, U 

PRINT, 

PRINT, U 

PRINT 

PRINT 

PRINT 

PRINT "DO YOU WANT TO BET AN ODD OR EVEN NUMBER"! 

INPUT AS 

IF AS « "NO" THEN 2050 

IF AS a "YES" THEN 1890 

GOSUB 2790 

GO TO 1830 

PRINT "ODD OR EVEN"! 

INPUT BS 

IF BS s "ODD"THEN 1950 

IF BS a "EVEN"THEN 1950 

PRINT "PLEASE TYPE ODD OR EVEN" 

GO TO 1890 

PRINT "HOW MUCH DO YOU WANT TO BET" I 

INPUT H 

IF H <a 10000 THEN 2000 

GOSUB 2810 

GO TO 1950 

FOR HI ■- TO 10000 

IF HI a H THEN 2060 

NEXT HI 

GOSUB 2840 

GO TO 1950 

LET H a 

PRINT 

PRINT "DO YOU WANT TO BET A RED OR BLACK NUMBER"! 

INPUT CS 

IF C.i ■ "NO" THEN 2290 

IF CS ■ "YES" THEN 2130 

GOSUB 2790 

GO TO 2070 

PRINT "RED OR BLACK"! 

INPUT DS 

IF DS a "RED" THEN 2190 

IF DS = "BLACK" THEN 2190 

PRINT "PLEASE TYPE RED OR BLACK," 

GO TO 2130 

PRINT "HOW MUCH DO YOU WANT TO BET"! 

INPUT I 

IF I <a 10000 THEN 2240 

GOSUB 2810 



BELOW IS THE PICTURE OF OUR GAMBLING TABLE," 



B «######♦############" 

,u$ 

1 * 2 * 3 #" 
,"* RED #BLACK# RED #" 
,US 

4 * 5 * 6 #" 
,"*BLACK* RED #BLACK#" 
,U8 

7*8*9*" 

RED *BLACK* RED *" 
,U$ 

10 * 11 * 12 #" 
,"*BLACK*BLACK* RED *" 
,US 

,"* 13 * 14 #15 #" 
,"*BLACK* RED *BLACK*" 
,US 
, "* 16 * 17 # 18 *" 

RED *BLACK# RED #" 
,US 
,"* 19 * 20 * 21 #" 

RED *BLACK* RED *» 
,US 

,"* 22 * 23 # 24 #" 
,"*BLACK# RED *BLACK#" 
,US 
, " * 2 5 #26 *27 #" 

RED * RED #8LACK*" 
,U$ 

,«# 28 * 29 # 30 #" 
, "#BLACK*BLACK* RED #« 
,US 

31 #32 # 33 #" 
,"#BLACK# RED #BLACK»" 
,U$ 

,'!« 34 #35 # 36 #" 
,"# RED #BLACK# RED #" 
,U$ 

"#COL,l#COL.2#COL.3#" 
,U$ 



190 



2230 GO TO 2190 
2240 FOR 12 a TO 10000 
2250 IF 12 a I THEN 2300 
■2260, NEXT 12 
2270 GOSUB 2840 
2280 GO TO 2190 
2290 LET I a 
2300 PRINT 

2310 PRINT "DO YOU WANT TO BET A COLUMN OF NUMBERS"! 
2320 INPUT BIS 

2330 IF Bl$ a "NO" THEN 2530 
2340 IF BIS a "YES" THEN 2370 
2350 GOSUB 2790 
2360 GO TO 2310 

2370 PRINT "COLUMN 1, 2, OR 3"! 
2380 INPUT B2 
2390 IF B2 a 1 THEN 2440 
2400 IF B2 a 2 THEN 2440 
2410 IF B2 a 3 THEN 2440 
2420 PRINT "PLEASE TYPE 1, 2, OR 3," 
2430 GO TO 2370 

2440 PRINT "HOW MUCH DO YOU WANT TO BET"! 
2450 INPUT B8 

2460 IF B8 <a 10000 THEN 2490 
2470 GOSUB 2810 
2480 GO TO 2440 
2490 FOR B9 a TO 10000 
2500 IF B8 a B9 THEN 2540 
2510 NEXT B9 
2520 GO TO 2440 
2530 LET B8 a 
2540 PRINT 

2550 PRINT "DO YOU WANT TO BET A NUMBER"! 
2560 INPUT E$ 

2570 IF E$ a "NO" THEN 28?0 
2580 IF E$ a "YES" THEN 2610 
2590 GOSUB 2790 
2600 GO TO 2550 

2610 PRINT "WHAT IS YOUR NUMBER"! 
2620 INPUT F 
2630 FOR M » TO 36 
2640 IF F a M THEN 2690 
2650 NEXT M 

2660 PRINT "THAT IS AN ILLEGAL NUMBER" 

2670 PRINT "YOU ARE ONLY ALLOWED TO BET INTEGERS RANGING FROM TO 36" 
2680 GO TO 2610 

2690 PRINT "HOW MUCH DO YOU WANT TO BET"!- 
2700 INPUT G 

2710 IF G <a 10000 THEN 2740 
2720 GOSUB 2810 
2730 GO TO 2690 
2740 FOR G9 a TO 10000 
2750 IF G a G9 THEN 2880 
2760 NEXT G9 
2770 GOSUB 2840 
2780 GO TO 2690 

2790 PRINT "PLEASE TYPE YES OR NO," 
2800 RETURN 

2810 PRINT "SORRY, BUT THE TABLE CANNOT ACCEPT A BET OF THAT MUCH"! 
2820 PRINT " MONEY." 
2830 RETURN 

2840 PRINT "SORRY, BUT YOU CAN ONLY BET IN SI INCREMENTS FROM SI TO"! 
2850 PRINT « $10000," 
2860 RETURN 
2870 LET G a 
2880 PRINT 
2890 RANDOMIZE 
2900 LET T a INT(37*RND) 
2910 PRINT "THE NUMBER IS "! 
2920 LET Tl a INT('T/10)*1 
2930 ON Tl GO TO 2940,2950,2960,2970 

2940 ON T+l GO TO 3530,3350,3430,3390,3410,3370,3450,3350,3430,3390 
2950 ON T-9 GO TO 3410,3490,3330,3470,3310,3510,3290,3490,3330,3350 
2960 ON T-19 GO TO 3430,3390,3410,3370,3450,3350,3310,3510,3410,3490 
2970 ON T-29 GO TO 3330,3470,3310,3510,3290,3490,3330 
3290 PRINT T!" RED, EVEN, COLUMN 1" 
3300 GO TO 3540 

3310 PRINT T!" RED, EVEN, COLUMN 2" 
3320 GO TO 3540 

3330 PRINT T!« RED, EVEN, COLUMN 3" 
3340 GO TO 3540 

3350 PRINT T!" RED, ODD, COLUMN 1" 
3360 GO TO 3540 

3370 PRINT T!" RED, ODD, COLUMN 2" 
3380 GO TO 3540 

3390- PRINT T!" RED, ODD, COLUMN 3" 
3400 GO TO 3540 

3410 PRINT T!» BLACK, EVEN, COLUMN 1" 
3420 GO TO 3540 

3430 PRINT T! " BLACK, EVEN, COLUMN 2" 
3440 GO TO 3540 

3450 PRINT T! " BLACK, EVEN, COLUMN 3" 
3460 GO TO 3540 

3470 PRINT Tl "BLACK, ODD, C0LUMN1" 
3480 GO TO 3540 

3490 PRINT I! "BLACK, ODD, COLUMN 2" 
3500 GO TO 3540 

3510 PRINT Tj "BLACK, ODD, COLUMN 3" 
3520 GO TO 3540 
3530 PRINT T 
3540 IF G a THEN 3610 
3550 IF T a F THEN 3590 

3560 PRINT " YOU LOSE $«G« FOR YOUR NUMBER BET," 
3570 LET G a -G 
3580 GO TO 3610 

3590 PRINT " YOU WIN $"35#G" FOR YOUR NUMBER BET," 
3600 LET G a 35#G ~ 
3610 IF Ha THEN 3800 r 
3620 IF T a THEN 3710 
3630 IF BS a "EVEN" THEN 3680 
3640 FOR X a 1 TO 35 STEP 2 
3650 IF T a X THEN 3750 
3660 NEXT X 
3670 GO TO 3710 
3680 FOR XI a 2 TO 36 STEP 2 
3690 IF T a XI THEN 3750 
3700 NEXT XI 

3710 PRINT " YOU LOSE S"Hj 
3720 GOSUB 3780 
3730 LET H a -H 



SAMPLE RUN 



3740 
3750 
3760 
3770 
3780 
3790 
3800 
3810 
3820 
3830 
3840 
3850 
3860 
3870 
3880 
3890 
3900 
3910 
3920 
3930 
3940 
3950 
3960 
3970 
3980 
3990 
4000 
4010 
4020 
4030 
4040 
4050 
4060 
4070 



4100 
4110 
4120 
4130 
4140 
4150 
4160 
4170 
4180 
4190 
4200 
4210 
4220 
4230 
4240 
4250 
4260 
4270 
4280 
4290 
4300 
4310 
4320 
4330 
4340 
4350 
4360 
4370 
4380 
4390 
4400 
4410 
4420 
4430 
4440 
4450 
4460 
4470 
4480 
4490 
4500 
4510 
4520 
4530 
4540 
4550 
4560 
4570 
4580 
4590 
4600 
4610 
4620 
4630 
4640 
4650 
4660 
4670 
4680 
4690 
4700 
4710 
4720 
47 30 
4740 
4750 



GQ TO 3800 

PRINT » YOU WIN $"H| 

GOSUB 3780 

GO TO 3800 

PRINT "FOR YOUR ODD-EVEN BET," 

RETURN 

IF I ■ THEN 4080 

IF T « THEN 3980 

FOR Al » 1 TO 9 STEP 2 

IF T ■ Al THEN 3970 

NEXT Al 

FOR A2 ■ 12 TO 18 STEP 2 

IF T ■ A2 THEN 3970 

NEXT A2 

FOR A3 b 19 TO 25 STEP 2 

IF T » A3 THEN 3970 

NEXT A3 

FOR A4 * 30 TO 36 STEP 2 

IF T ■ A4 THEN 3970 

NEXT A4 

IF T ■ 26 THEN 3970 

IF DS * "BLACK" THEN 4020 

GO TO 3980 

IF D$ = "RED" THEN 4020 

PRINT " YOU LOSE 8»I| 

GOSUB 4060 

LET I s .1 

GO TO 4080 

PRINT " YOU WIN $»; 

PRINT If 

GOSUB 4060 

GO TO 408 

PRINT "FOR YOUR RED-BLACK BET," 

RETURN 

IF B8 s THEN 4340 

IF T a THEN 4300 

FOR B3 b 1 TO 34 STEP 3 

IF T « B3 THEN 4190 

NEXT B3 

FOR B4 a 2 TO 35 STEP 3 

IF T ■ B4 THEN 4210 

NEXT B4 

FOR 85 ■ 3 TO 36 STEP 3 

IF T ■ B5 THEN 4230 

NEXT B5 

IF B2 b 1 THEN 4250 

IF B2 <> 1 THEN 4300 

IF B2 s 2 THEN 4250 

IF B2 <>' 2 THEN 4300 

IF B2 » 3 THEN 4250 ■ ■ 

IF B2 <> 3 THEN 4300 

PRINT " YOU WIN S"> 

PRINT 2*B8f '•'; 

PRINT "FOR YOUR COLUMN BET," 

LET B8 b 2#B8 

GO TO 4340 

PRINT " YOU LOSE $»> 

PRINT B8f 

PRINT "FOR YOUR COLUMN BET," 

LET B8 b -B8 

PRINT 

LET K « CG) + CH) + CD + CB8) 

IF K < THEN 4400 

IF K b THEN 4420 

IF K > THEN 4440 , 

GO TO 4450 

PRINT " YOU LOST $" ABS(K)" ON THIS ROUND," 

GO TO 4450 

PRINT " YOU BROKE EVEN THIS TIME," 

GO TO 4450 

PRINT " YOU WON $"K" ON THIS POUND," 

PRINT 

PRINT 

LET Kl b Kl + K 

IF Kl < THEN 4510 

IF Kl ■ THEN 4530 

IF Kl > THEN 4550 * 

PRINT " YOU HAVE LOST A TOTAL OF $"A8S(K1)" THUS FAR," 

GO TO 4570 

PRINT " THUS FAR YOU HAVE BROKEN EVEN," 

GO TO 4570 

PRINT "YOU HAVE WON A TOTAL OF $"K1" THUS FAR," 

GO TO 4570 

PRINT 

PRINT " DO YOU WANT TO PLAY AGAIN"! 

INPUT MS 

IF MS a "NO" T«EN 4640 

IF MS b "YES" THEN 1800 

PRINT "PLEASE TYPE YES OR fl.Oy" 

GO TO 4580 

PRINT 

PRINT " THANKS FOR PLAYING," 

IF Kl < THEN 4690 

IF Kl b THEN 4710 

IF Kl > THEN 4740 

PRINT " YOU LOST S" ABSCKU*", BETTER LUCK NEXT TIME," 

GO TO 4750 

PRINT " YOU BROKE EVEN TODAY, MAYBE NEXT TIME YOU WILL WIN"> 

PRINT « A FORTUNE^ 

GO TO 4750,-" 

PRINT " CONGRATULATIONS, YOU BEAT THE tfDDS, YOU WON $"Kl"TODAY. 

END 



WELCOME TO I10NTE CARLO AND OUR EUROPEAN ROULETTE TABLE. 
I WISH VOU THE BEST OF LUCK. 



DO VOU WANT INSTRUCTIONS ?YES 

THIS IS A GAME OF ROULETTE. VOL" ARE ALLOWED TO BET 
AN ODD OR EVEN NUMBER AND/OR A BLACK OR RED NUMBER AND/OR 
A COLUMN OF NUMBERS AND/OR A NUMBER ITSELF. NUMBERS RANGE 
FROM O TO 36. IF B APPEARS, THE BANK COLLECTS ALL BETS 
EXCEPT THOSE BET ON THE NUMBER O. THE PAVOFFS ARE AS FOLLOWS 

ODD OR EVEN = 1 TO 1 

RED OR BLACK » 1 TO 1 

A COLUMN = 2 TO 1 

A NUMBER = 35 TO 1 
VOU RRE ALLOWED TO BET FROM $1 TO *1B00B, BUT THE TABLE WILL ONLV A 
CCEPT BETS OF WHOLE DOLLARS <NO CENTS). 

WOULD VOU LIKE TO SEE A PICTURE OF THE GAMBLING TABLE ?VES 

BELOW IS THE PICTURE OF OUR GAMBLING TABLE. 



*********** 

* * 
******************* 

* i * 2 * 3 * 

* RED *BLACK* RED * 
******************* 

* 4 * 5 ' * 6 * 
♦BLACK* RED *BLACK* 
******************* 

* 7 * 8 ■ * ' 9 * 

* RED *BLACK* RED * 
******************* 

* IB * 11 * 12 * 
*BLACK*BLACK* RED * 
******************* 

* 12 * 14 * 15 * 
♦BLACK* RED *BLACK* 

* 16 * 17 * 18 * 

* RED *BLACK* RED * 
******************* 

* 19 * 20 * 21 * 

* RED *BLACK* RED * 

* * * * * * * * * * * * * * * * * * * 

* 22 * 22 *■ 24 * 
♦BLACK* RED *BLACK* 

* 25 * 26 * 27 * 

* RED * RED *BLACK* 

* 28 * 29 * 20 * 
*BLACK*BLACK* RED * 
******************* 

* 31 * 32 * 33 * 
♦BLACK* RED *BLACK* 

* * * * * * * * * * * * * * * * * * * 

* 34 * 35 * 36 * 

* RED *BLACK* RED * 
** * * * * * * * * * * * * * * * * * 
*COL. l*COL. 2*C0L. 3* 
* ****************** 



DO VOU WANT TO BET AN ODD OR EVEN NUMBER ?VES 

ODD OR EVEN ?ODD 

HOW MUCH DO VOU WANT TO BET ?100 

DO VOU WANT TO BET A RED OR BLACK NUMBER ?NO 

DO VOU WANT TO BET A COLUMN OF NUMBERS' ?VES 

COLUMN 1, 2, OR 3 ?1 

HOW MUCH DO VOU WANT TO BET ?18@ 

DO VOU WANT TO BET A NUMBER ?NO 

THE NUMBER IS 1 RED, ODD, COLUMN 1 
VOU WIN * 10© FOR VOUR ODD-EVEN BET. 
VOU WIN * 2O0 FOR VOUR COLUMN BET. 

VOU WON * 200 ON THIS ROUND. 



VOU HAVE WON fl TOTAL OF $ 30@ THUS FAR. 
DO VOU WANT TO PLAV AGAIN ?VES 



DO VOU WANT TO BET AN ODD OR EVEN NUMBER ?VES 

ODD OR EVEN ?EVEN 

HOW MUCH DO VOU WANT TO BET ?100 

DO VOU WANT TO BET A RED OR BLACK NUMBER ?VES 

RED OR BLACK ?RED 

HOW MUCH DO VOU WANT TO BET ?100 

DO VOU WANT TO BET A COLUMN OF NUMBERS ?ND ' 

DO VOU WANT TO BET A NUMBER ?VES 

WHAT IS VOUR NUMBER ?6 

HOW MUCH DO VOU WANT TO BET ?10 



THE NUMBER IS 9 RED, ODD, COLUMN 3 
VOU LOSE * 10 FOR VOUR NUMBER BET. 
VOU LOSE * IBS FOR VOUR ODD-EVEN BET. 
VOU WIN $ 160 FOR VOUR RED-BLACK BET. 

VOU LOST * IS ON THIS ROUND. 



VOU HAVE WON fl TOTAL OF * 29B THUS FAR. 
191 D ° V0U WftNT T ° FLftV ftGflIN ?VES 



RUSROU 



RUSSIAN ROULETTE 



Description 

In this game, you are given by the computer a revolver loaded 
with one bullet and five empty chambers. You spin the chamber 
and pull the trigger by inputting a "1," or, if you want to 
quit, input a "2." You win if you play ten times and are still 
alive. 

Program Author 

Two versions of Russian Roulette were submitted, one by John 
Kowalik of East Greenwich, RI and the one printed here by: 

Tom Adametx 

Curtis Junior High School 

Sudbury, MA 01776 



5 RANDOMIZE 

8 PRINT "THIS IS A GAME OF >»»»»»RUSSI AN ROULETTE" 

10 PRINTSPRINT "HERE IS ft REVOLVER" 

20 PRINT "HIT -1' TO SPIN CHAMBER AND PULL TRIGGER • 

22 PRINT " <HIT ' 2' 1 TO GIVE UP) "SPRINT "GO": 

25 N-0 

30 INPUT I 

31 IF I<>2 THEN 35 

32 PRINT " CHICKEN ! ! ! "SGOTO 72 
35 N = N+1 

40 IF RND<0>>0. 83323 THEN 70 
45 IF N>10 THEN 80 
59 PRINT "- CLICK -" 
•50 PRINTSGGTO 30 

70 PRINT " BANG!!!! YOU'RE DEAD!" 

71 PRINT "CONDOLENCES WILL BE SENT TO YOUR RELATIVES " 

72 PRINT\PRINT\PRINT\PRINT " .. NEXT VICTIM. "\GnTn *A 
30 PRINT "YOU WIN ! ! ! " 

85 PRINT "LET SOMEONE ELSE BLOW HIS BRAINS OUT " 
90 GOTO 10 
39 END 

READY 



THIS IS A GAME OF »»>»»>>RlJSSlftN ROULETTE 

HERE IS ft REVOLVER 

HIT 'I'' TO SPIN CHAMBER AND PULL TRIGGER. 

<HIT '2' TO GIVE UP) 
G0?1 

- CLICK - 

?1 



-?1 

- CLICK - 



?1 

- CLICK 



?1 

- CLICK - 

?1 

BANG! ! ! ! YOU'RE DEAD! 
CONDOLENCES WILL BE SENT TO YOUR RELATIVES. 



. . . NEXT VICTIM. '. . 

HIT '1" TO SPIN CHAMBER AND PULL TRIGGER. 

<HIT '2' TO GIVE UP) 
GO? 




192 



1 963 by E . C. Publications 



SALVO 



NAVAL GUN BATTLE 



Description 



The rules are not explained by the program, so read carefully 
this description by Larry Siege 1, the program author. 

"SALVO is played on a 10x10 grid or board using an x,y coordinate 
system. The player has 4 ships: battleship (5 squares), cruiser 
(3 squares), and two destroyers (2 squares each). The ships 
must be placed horizontally, vertically, or diagonally and must 
not overlap. The ships do not move during the game. 

"As long as any square of a battleship still survives, the player 
is allowed three shots, for a cruiser 2 shots, and for each 
destroyer 1 shot. Thus, at the beginning of the game the player 
has 3+2+1+1=7 shots. The player enters all of his shots and 
the computer tells what was hit." A shot is entered by its grid 
coordinates, x,y. The winner is the one who sinks all of the 
opponent's ships. 

Important note: Your ships and the computer's ships are located 
on 2 separate 10x10 boards. For a simpler version of this game, 
try SALV01. 

Program Author 

Lawrence Siege 1 
3052 Warrington Road 
Shaker Heights, OH 44120 




193 



PROGRAM LISTING 

1000 REM *** SALVO BY LARRY SIEGEL 

1010 REM *** LAST REVISION 6/9/73 

1020 REM *** CHECKED OUT ON RSTS/E BY DAVE AHL, DIGITAL 

1030 REM *** 

1040DIMA(10,10),BC10,10),CC7),D<7),E(12),F(12),6ci2),HCi2),KC10,10) 

1050LETZ8«0 

1060FORM1TO12 

1070LET£(wD»-l 

1080LEtH(W)«-l 

109&NEXTN 

1100FQRX«1TO10 

1110FORY«lTQ10 

1120L£TB(x#Y)«0 

1130NEXTY 

1140NEXTX 

1150FORXalTO12 

li60LETF(X)*0 

1170LETG(X)«0 

1180NEXTX 

1190FORX*1TO10 

120BFORY»1TO10 

1210LETA(X#Y)*0 

1220NEXTY 

1230NEXTX 

t240FORK«4TOlSTEP-l 

1250LETU6=0 

1260GO3UB2913 

1270DEFFNA(Kj»t&-K)*3*2*lNT(K/4)+SGN(K-l)*.i 

1260DtFFMBCKJ*K*INT(K/4)-3GN(K-l) 

1290IFV+V2+V*V2s0THEn1260 

1300IFY+V*FN8CK)>10THEN1260 

1310IFY+v*FmB(K)<1TmEn1260 

1320lFX*V2*KNd(K)>10THEMia6a 

1330IF X + v2*j-^8(K)<lTHEfvl260 

1340LETU6«U6+1 

1350lPU6>25THEMi90 

1360FORZ»«TOFNB(K) 

137WLETF(Z*FnA(k))«X*v2*2 

l380LETG(Z+FNA(K))«Y+V*Z 

1390NfcXTZ 

1400LETU8«FNA(K) 

1410FORz2sy8TOu8 + t i N3(K) 

1420FORZ3*lTOu8-! 

1430 USQ»(CF(Z3)-F(Z2))a2+(GCZ3)-GCZ2))a2)<3,S9TMEN 1260 

1440NEXTZ3 

1450NEXTZ2 

1460FOHZ«0TOFNB(K) 

1470LETA(F(Z*U8) f G(Z+U8))«.8+3GN(K-1)*(K-1,5) 

1480NEXTZ 

1490NEXTK 

1500PRlNT»EMt»* COORDINATES FOR..." 

1510PRlN7'»8ATTLESHlP» 

1520FORXS1TO5 

1530InPUTY,Z 

lS40LETb(Y#Z)»J 

l&5BNfc-XfX 

1560PRINT"CRUISER" 

1570FORX«lTO3 

1S80IMPUTY.Z 

1590LET9(y,Z)«2 

1600NEXTX 

1610P«IiMT"DeSTROYtW<A>" 

1620FORX»1TO2 

lb30lNPUTY,Z 

lb40LET6(y,z)»l 

1650NEXTX 

1660PRlNT"DfeSTRCYER<8>» 

1670FORX*1TO2 

1680INPUTY,Z 

1690LET8(Y,Z)*.b 

1700NEXTX 

17i0PRIM"Du YOU *AMT TO START"; 

1720IN.PUTJ5 

173-0IFJ$O"wHE«E ARt YOUR SHIPS?"THEN1890 

174(flPRlNT«eATTLfc3hIP" 

1750FORZ»lTOb 

1760PRINTF(Z)>G(Z) 

1770NEXTZ 

1780PRI.mT"CkhJ.Sc.R" 

1790PRIMF(61?G(6) 

1800PRINTF(7) JG(7) 

1810PKINTK8);G(8) 

1320PRI^T"DESTRGYER<A>" 

1B30P«IMK9)|G(9) 

1840PRlNTF(l0)?b(i0) 

1850PRlNT«Dt"ST«OYER<B>" 

1860PRlMTF(in ?G(li) 

i870PRlNTF(12)|&(12) 

1880GOTO171W 

1890LETC»u 

1900PRlNT» , OQ YOU *AnT TQ SEE MY SHOTS"! 

1910INPUTKS 

1920PRIMT 

l930IFJS<>»YtS"THEN262^ 

1940REM*** ******** ***ST APT 

195MlFj*o»YES"THEMi99^ 

1960LETCaC+l 

1970PR1NT 

1980P«INT"TURN»C 

1990LETASS5 

2000FoR«*,5TO33TEP,5 

2010FORXS1TO10 

2020FORY«1TO10 * 

2030lF8(X # Y)«wTHEN2070 

2040NEXTY 

205MNEXTX 

2060GOTO2-08B 

2070LETA»A+lNT(^+,5) 

2080NEXTW 

2090FORw«lTO7 

2100LETC(:O«0 

2ll0LETO(w).0 

2120LETF(w)s^ 

2130LETG(W)»0 

2140NEXT* 

2150LETP3«P 

2160FORX«1T010 

2170FORYMTO10 



2180IFACX,Y)>10THEN2200 
2190LETP3«P3+1 
2200NEXTY 
2210NEXTX 

2220PRINT»YOU HAVE" A"SHOTS» 
2230IFP3>«ATHEN2260 

2240PRINT»THE NUMBER OF YOUR SHOTS EXCEEDS THE NUMBER OF BLANK SQUARES" 
2250GQTQ2890 
2260IFA<>0THEn2290 
2270PRINT M I HAVE *ON" 
2280STOP 
2290FORW«1TOA 
2300InPUTX,Y 
2310IFX<>INT(X)THEN2376J 
2320lFX>l0ThEN2374 
2330IFX<1THEN2370 
2340IFY<>INT(Y)THEN2370 
2350IFY>10THEN2370 
2360lFY>*iThEN2390 
2370PRINT"ILLEGAL» EMTER AGAIN" 
2380GOTO2300 
2390IFA(X,Y)>10THEN2440 
240BLETC (*.)«* 
2410LETD(*)«Y 
2420NEXTW 
2430GOTO2460 

2440PRlNT"YOu SHOT THERE BEFORE ON TURN" A ( X, Y) «*10 
2450GOTO2300 
2460FORW«1TOA 

2470IFA(C(W),D(^))«3THEN2b40 
248aiFA(C(W)fD(*))»2TriEN256lJ 
2490iFA(Cfw),D(^))«lTHEN2580 
2500IFACC(W),D(iO)*,5THEN2600 
2510LETA(CCw)#D(<«i))»10 + C 
.2520NiEXTw 
2530GOTO262W 

2540PRINT»YOU HIT *Y BATTLESHIP" 
2b50GOTO26i0 

2S60PRlN'T"YOU HIT MY CRUlsER" 
2570GOTO2510 

2b80PRINT H YQU HIT MY DESTROYER<A>» 
2b90GOT'O2bl0 

2600PRINT"YOU HIT MY DESTRQYER<6>" 
2610GOTO2510 
2620LETA»0 

263^IFJ$b«yES ,, ThEN2670 
2640L£TC»C+1 
2650PRINT 
2660PRINT"TUPN"C 
2670LETAS0 

2680FoRW".bTO3 t lSTEp,5 
2690FORXMTui0 
2700F0RY«1TO1'2 
2710IFACX, Y)«WTHEN2750 
2720NEXTY 
2730NEXTX 
2740GOTO2760 
2750LtTA«A+INTCw*,5) 
2760NEXT* 
2770LETP380 
2780FQRXS1TQ10 
2790FORY«ITO10 
2800IFB(X,Y)>l^THEN2820 
2810LETP3*^J+1 
2820NEXTY 
2830NEXTX 

2840PRINT"! HAVF.»'A«SHOTS" 
2850IFPJ>ATHEN2880 

2860PRINT»THE NyMBER OF MY SHOTS EXCEEDS THE NUMBER QF BLANK SQUARES" 
2870G0TQ2270 
2880IFAO0THEN2960 
2890PHIM"YOU HAVE wOn" 
2930STOP 

291BLETX»IMT((RND'(-n*10)*l) 
2920LETY«INT((RNDC-l)*10)*l) 
2930LETV»INTC3*RND(-1)-1) 
2940LETV2»lNTf3*RNO(-l)-l) 
295WKETURN 
2960FORw«iTO12 . 
2970lFH(w)>0THtN380t* 
2980NEXTW 

2990RtM**************RANOQM 
300i3LETw*0 
3010LETR3.0 
3020GOSU82910 
3030RESTORE 
3040LETR2»0 
3050LETR3«R3+i 
306HlFR3>103THEfs3010 
3070lFX>10ThtN3ll^ 
3080IFX>0THE^3120 
3090LETXsl*lsiT C«ND(-l)*2.b) 
3100GOTO3120 

3110LETXsl0-lNT(RNO(-l)*2,5) 
3l20lFY>10THEN3l6a 
3130lFY>0THtN3270 
3140LETY*l+INTCRNO(-l)*2.b) 
3150GQ-TO3270 

3160LETY*10-INJT(RNOC-I)*2,b) 
3170GQTO3270 
3180LETF(vOax 
3l90LETG(wl»Y 
3200IFWsATHEN3380 
3210IFR2«6THfcN3030 
3220READX1, Yl 
323tfLETR2«R2+l 

3240OATAl # l,-l,i,lf-3,l,l,0,2 f -l,l 
3250LETX*X+X1 
3260LETY«Y*Y1 
3270IFX>10THEN3210 
3280lFX<lTHEN32i0 
3290IFY>10THEn3210 
3300IFY<1THEN3210 
331«IFB(X,Y)>10ThEN3210 
3320FORQ9»1TOW 
3330IFF(Q9)oxTHEN3350 
3340IFG(Q9)*YTHEN321^ 
3350NEXTQ9 



194 



10 
9 



3360LfcTMW*l 
3370GOTO3180 
3380lFK$o»YES»THtN3420 

3390FORZ5-1TQA 

3400PRINTF(Z5)>6(ZSJ 

3410NEXTZ5 

3420FORW«1TOA 

3430IF8(F(w),G(w5)»3THEN35ia0 
3440IF8CF(W),G(W))»2THEN3S20 
3450lF'e(F(wj,G(W})«iTHEM35tt* 
3460lFB(F(W),G(^))«.bTHEN3540 
3470LETB(F(w),G(w))«10+C 
3480NEXTW 
3490GQTO19S0 

3500PRINT»I HIT YOUR BATTLESHIP" 
3510GOTU3570 

3b20PRINT"I HIT YOUR CRUISER" 
3530GOTO3570 

3540P«INT"I HIT YOUR DESTROYER<B>« 
3550GQTO3570 

3560PRINT''I HIT Y U R DEST«OYER<A>" 
3b70FOR«siTO12 
3580IFE(U)<>-1THEN3730 
3590LETE(Q)»10+C 
360BLtTH(Q)«8cFCW),G(»)J 
3610LETWI3B0 
3620FORM2»1TO12 
3630IFHCH2)<>HCO)THtN36b0 
3640M3*M3+1 
3650NEXTM2 

3560IFM3<>INTCH(Qj4..5) + i*iNT(IWT(H(Q)*.5)/3)THEN3470 
3670FO»M2*iTQl2 
3680IFH(M2)<>H(Q)THEN3710 
3690LETE(M2)*-1 
3700LETM(M2)»-1 
3710NEXTM2 
3720GOTO3470 
3730NEXTQ 

3740PRINT»PROG»AM ABORT:" 
3750FORUB1TO12 
3760PftlNT"E("Q H )« H E(Q> 
3770PRlNT"H( ,, Q ,, )«"H(Q) 
3780NEXTQ 
3790STOP 

3800HEM**************IJSINiGEARRAY 
33i0FORR«lTOl^ 
3820FORSsiTO12 
3830tET*C«,S)»0 
3840NEXTS 
385MEXTR 
3860FORU*1TO12 
3370IFE(U)<i r ^THtN4020 
3880FQRRslTQ10 
3890FORS"! TOl^ 
3900IFBCR,S)<U5THEN3930 
39l0LETK(R,S)B-i0»0iif-10 
3920GQTO4tfi,-K<* 

393.0FOHMisGN(l*R)TOS-G.>i(ia«R) 
3940FORM«sGN(l*s) TOSGn(IM-S) 
3950IP N + M + N*Hav)THEN39«0 
3960IFB(R + ,i,3 + N)<>E(U)THEn3980 
3970LETn(K,S)«K(R,S)*E(u)-2*IimT(h('.J)*.5J 
3980NEXTN 
3990NEXTM 
4000NEXTS 
4010NEXTR 
4023NEXTU 
4030F-'ORR*1TOA 
4040LETFfR)»R 
■4050|.ETG(R') 8 R 
4060NEXTR 
4070FORH«1TO10 
4080FORS«1TO10 
4090LETQ9sl 
4100FORM«1TOA 

4il0lFK(Fc-M),G(M))->»K(F(a9i#GC-O9))THEN4l3a 
4120LETQ9*M 
4130NEXTM 

4131 IF R>ATHEM140 

4132 IF R»S ThEm 4210 
4i40IFKCR,S)<KCF(Q9)fG(O9))THEN4210 
4150FQRMS1TOA 
4160IFF(H)<>RTHEN4190 
4170IFG(M).STHEN4210 

4180NEXTM 

4190LETF(Q9)«R 

4200LETGCQ9)»S 

4210NEXTS 

4220NEXTR 

4230GOTO3380 

4240END 



Player's shots against 
the enemy. Number 
indicates the round 
of the game on 
which the shot was 
fired. The initial 
objective was to destroy 
the enemy battleship — 
it took 6 rounds to accom- 
plish this objective. 





14 


l3 / 


/£ 


13 


14 








13 


10 


^^ 


/io 


3 


11 


13 






12 


3 


10 


3 


10 


3 


6 6 






12 


11 


3 


11 


3 


11 


5 f 


\ 5 




14 


2 


12 


2 


12 


2 


2 








y 


? 


1 


1 


1 


1 1 


7 


7 


/ 


4, 


^ 


5 


2 


5 


2 5 






& 


A 


4 


9 


4 


9 


5 \e 








4 


8 


4 


8 


f*l 










9 


4 


8 


4 


w 









SAMPLE RUN 

ENTER COORDINATES' FOR. 

BATTLESHIP 

? 3, 4 

? 4, 5 

? 5,6 

? 6,7 

? 7, 8 

CRUISER 



? 9,2 

DESTR0VER<fl> 

? 2, 9 

? 3, 8 

DESTR0VER<B> 

? 8, 5 

? 8, 6 

DO VOU WANT TO START? YES 

DO VOU WANT TO SEE MY SHOTS? YES 



TURN 1 

YOU HAVE 7 SHOTS 

? 2, 5 

? 3, 5 



? 6,5 
? 7, 5 
? 8, 5 

YOU HIT MY CRUISER 
YOU HIT MY BATTLESHIP 
I HAVE 7 SHOTS 
1 3 



I HAVE 7 SHOTS 



TURN 2 




VOU HAVE 7 


SHOTS 


? 2,6 




? 3, 4 




? 4, 6 




? 5, 4 




?■ 6, 6 




? 7, 4 




? 8, 6 




YOU HIT MY 


BATTLESHIP 


I HAVE 7 SHOTS 


6 3 




7 4 




6 .5 




7 2 




8 3 . 




8 5 




7 6 




I HIT YOUR 


CRUISER 


I HIT YOUR 


DESTROYED 


TURN 3 




YOU HAVE 7 


SHOTS 


? 2, 8 




? 3, 7 




? 3, 9 




? 4, 8 




? 5, 7 





YOU HIT MY DESTROVER<B> 
I HAVE 7 SHOTS 



I HIT YOUR CRUISER 



TURN 4 






YOU 


HAVE 


7 


SHOTS 


o 


2. 


2 






•> 


3. 


3 






? 


3. 


1 






? 


4. 


2 






■7 


5, 


1 






•? 


5. 


3 







YOU HIT MY DESTROYER<A> 
I HAVE 7 SHOTS 



I HIT YOUR DESTROYER<B> 

TURN 5 

YOU HAVE 6 SHOTS 

? 4, 4 



YOU HIT MY BATTLESHIP 



5 
5 
9 
16 



7 1 
I HIT YOUR BATTLESHIP 
I HIT YOUR CRUISER 
I HIT YOUR BATTLESHIP 

TURN 6 

YOU HAVE 4 SHOTS 



YOU HIT 


■1Y BATTLESHIP 


YOU HIT 


IV BATTLESHIP 


I HAVE 4 


SHOTS 


5 7 




9 1 




16 6 




4 4 




TURN 7 




YOU HAVE 


4 SHOTS 


? 2, 3 




2? ,4 




? 9, 5 




? IS, 5 




VOU HIT 


MY CRUISER 


I HAVE 4 


SHOTS 


10 4 




4 3 




4 5 




4 6 




I HIT YOUR BATTLESHIP 


TURN 8 




YOU HAVE 


4 SHOTS 


?. 1, 3 




? 3, 2 




? 4, 1 




? 5, 2 




YOU HIT 


1Y CRUISER 


I HAVE 2 


SHOTS 


19 3 




4 7 




TURN 9 




YOU HAVE 


4 SHOTS 


? 2, 1 




? 4, 3 




? 6, 1 




? 6, 3 




YOU HIT 


•1Y DESTROYER<A> 


1 HAVE 1 


SHOTS 


5 2 




TURN 18 




YOU HAVE 


4 SHOTS 


? 2, 9 




? 3, 8 




? 4, 9 




? 5, 8 




I HAVE 1 


SHOTS 


4 2 




TURN 11 




YOU HAVE 


4 SHOTS 


? 2, 7 




? 4, 7 




? 6, 7 




? 6, 9 




I HAVE 1 


SHOTS 


3 6 




TURN 12 




VOU HAVE 


4 SHOTS 


? 1, 7 




? 1, 8 




? 3, 6 




? 5, 6 




I HAVE 1 


SHOTS 


3 4 




■I HIT YOUR BATTLESHIP 


TURN 13 




YOU HAVE 


4 SHOTS 


? 1, 9 




? 3, 10 




? 5, IS 




? 7, 9 




I HAVE 1 


SHOTS 


16 2 




TURN 14 




YOU HAVE 


4 SHOTS 


? 2, 10 




? 4, 10 




? 6, 10 




? 1, 6 




YOU HIT MY DESTROVER<B> 


I HAVE O 


SHOTS 


YOU HAVE 


WON 



195 



SALVO 1 



ARMY GUN BATTLE 



Description 



SALV01 is played on two, 5x5 grids or boards with 25 outpost 
locations numbered 1 to 25. Both you and the computer have 
four platoons of troops that can be located at any four out- 
posts on your respective grids. 

At the start of the game, you locate (or hide) your four 
platoons on your grid. The computer does the same on its 
grid. You then take turns firing missiles or bonibs at each 
other's outposts trying to destroy all four platoons. The 
one who finds all four opponent's platoons first, wins. 

Program Author 

This program was slightly modified from the original submitted by: 

Martin Bur dash 
70 Pinetree Drive 
Parlin, NJ 08859 




1 967 by Creative Publications 



196 



PROGRAM LISTING 



100 

110 

120 
130 
135 
140 
150 
160 
170 
180 
190 
200 
210 
220 
250 
260 
270 
280 
290 
300 
350 
380 
390 
400 
410 
420 
430 
440 
450 
460 
470 
480 
490 
495 
500 
510 
520 
530 
540 
550 
560 
570 
575 
580 
590 
600 
610 
620 
630 
640 
670 
680 



PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRINT 
PRIN 
PRINT 
PRINT 
PRINT 

for r 

RANDO 
DIM M 
FOR R 
I«(R- 
PRINT 
NEXT 
FOR R 
LET C 
» I 
E ■ I 
F ■ I 
IF C 



"YOU ARE ON A BATTLEFIELD WITH 4 PLATOONS AND YOU" 
"HAVE 25 OUTPOSTS AVAILABLE WHERE THEY MAY BE PLACED," 
"YOU CAN ONLY PLACE ONE PLATOON AT ANY ONE OUTPOST," 
"THE COMPUTER DOES THE SAME WITH ITS FOUR PLATOONS," 

"THE OBJECT OF THE GAME IS TO FIRE MISSILES AT THE" 
"OUTPOSTS OF THE COMPUTER, IT WILL DO THE SAME TO YOU. 
"THE ONE who DESTROYS ALL FOUR OF THE ENEMY'S PLATOONS 
"FIRST IS ThE WINNER," 



"GOOD LUCK, 



AND TELL US WHERE YOU WANT THE BODIES SENTJ" 



TEAR qFF THE MATRIX AND USE IT TO CHECK OFF THE NUMBERS. 

t TO 5\PRINT\n£xT R 
MIZE 
(100) 

■1 TO 5 ■ ' 
i)*5+l 

I, 1*1, 1+2, 1+3, 1*4 

1 TO 10\PRINT\N£XT R 
* IMT(RND(N) * 25) + 1 



1 



+ 1 



(RNO(N) * 25) 

CRNO(N) *25) +1 

(RNDCN) * 25) 

P GOTO 390 
IF C ■ E GOTO 400 
IF C ■ F GOTO 410 
IF D • E GOTO 400 
If D i F GOTO 410 
IF E * F-GOTO 413 

HAT ARE YOUR FQUR POSITIONS"! 
H,K,L 

HERE DO YOU w X SH TO FIRE YOUR MISSILE"? 



PRINT 
INPUT 
PRINT 
PRINT 
INPUT 
IF Y * 
IF Y 
IF Y 
IF Y 
GOTO 
M * I 
GOTO 
IF X 
IF X 
IF X 
IF X 
GOTO 
PRINT 
PRINT 
PRINT 
PRINT 



C 

■ D 
s fc 

■ F 

NT(RNPCN) 
116 



GOTO 7\v> 
GOTO 710 
GOTO 710 
GOTO 710 



GOTO 923 
GOTO 920 
GOTO 920 
GOTO 920 

k f HA YOU HISSED, MY TURN NOW 
INTNGOTO 570 

ISSEU YOU, YqU DIRTY RAT, I PlCKED"JMj«, y UW TURN," 
INTVG0T.0 50& 



710 s +1 

720 IF Q « 4 GOTO 890 

730 PRINT "YOU GOT ONE OF MY OUTPOSTS," 

740 IF Q ■ 1 GOTO 77* 

750 IF U * 2 GOTO 81,0 

760 IP • 3 GOTO 850 

770 PRINT » ONE DO*N THrEE TO GO" 

780 PRINT\PRINT\GQT0 570 

810 PRINT " TwO DOWN TWO- TO GO" 

820 PRINTVPRINtSGOTO 57tf 

850 PRINT " THRfeE DOWN 0*E TO GO'' 

860 PRINT\PRINT\GQTQ $7(» 

890 PRINT " YOU GUT *E, I'm GOING FAST, BUT I'LL GET YOU WHEN » 

900 PRINT " Y TRANSISTORS SECUPERA E" 

910 GOTO 1235 

920 Z*Z*1 

930 IF Z*4 THEN U10 

940 PRINT "I GOT YOU, IT wONiT BE LONG NOW, POST"X«WAS HIT," 

950 IF Z»l THEN 990 

960 IF Z»2 THEN 10.30 

970 IF Z*3 THEN }070 

990 PRINT "YOU HAVE O^LY THREE OUTPOSTS LEFT" 

1000 PRlNT\PRINT\GOTO 5 fe3 

1030 PRINT "YOU HAVE ONLY TWO OUTPOSTS LEFT," 

104k) PRINT\PRINT\GOTO 500 

1070 PRINT "YOU HAVE ONLY ONE OUTPOST LEFT." 

1080 PRINT\PRINT\GOTO 500 

1110 PRINT » YOU'RE DEAD. YOUR LAST OUTPOST WAS AT"X». HA, HA, HAJ" 

1120 PRINT " BETTER LUC* nEXT TIME." 

1150 GOTO 1235 

1160 P«P+1 

1170 NsP-t 

1180 FOR T ■ 1 TO N 

U90 IF M b M(T) GOTO 570 

1200 NEXT T 

1210 X * M ' 

1220 MCP) « M 

1230 GOTO 580 

1235 END 



SAMPLE RUN 

YOU ORE ON A BATTLEFIELD WITH. 4 PLATOONS AND VOU 
HAVE 25 OUTPOSTS AVAILABLE WHERE THEV MAY BE PLACED. 
VOU CAN ONLV PLACE ONE PLATOON AT ANV ONE OUTPOST. 
THE COMPUTER DOES THE SAME WITH ITS FOUR PLATOONS. 

THE OBJECT OF THE CAME IS TO FIRE MISSILES AT THE 
OUTPOSTS OF THE COMPUTER. IT WILL DO THE SAME TO VOU. 
THE ONE WHO DESTROYS ALL FOUR OF THE ENEMY' S PLATOONS 
FIRST IS THE WINNER. 

GOOD LUCK... AND TELL US WHERE VOU WANT THE BODIES SENT! 

TERR OFF THE MATRIX AND USE IT TO CHECK OFF THE NUMBERS. 



11 

16 
21 



13 
18 



10 
15 
20 
25 



WHAT ARE YOUR FOUR POSITIONS? 10, 15.. 20, 25 



WHERE DO VOU WISH TO FIRE YOUR MISSILE? 
HA, HA VOU MISSED, MY TURN NOW 



I MISSED VOU, VOU DIRTY RAT. I PICKED 9 . YOUR TURN. 



WHERE DO VOU WISH TO FIRE YOUR MISSILE? 
HA, HA VOU MISSED. MV TURN NOW 



■I MISSED VOU, VOU DIRTY RAT. I PICKED 22 . YOUR TURN. 



WHERE DO VOU WISH TO FIRE -YOUR MISSILE? 8 
HA, HA VOU MISSED. MV TURN NOW 



I MIS S E D V U , V U DIRTY RAT. I PI C K E D 5 . V U R T.U R N . 



WHERE DO VOU WISH TO FIRE YOUR MISSILE? 
HA, HA VOU MISSED. MV TURN NOW 



I MISSED VOU, VOU DIRTY RAT. I PICKED 4 . YOUR TURN. 



WHERE DO VOU WISH TO FIRE YOUR MISSILE? 10 
HA, HA VOU MISSED. MV TURN NOW 



I MISSED V U , V U D I R T V RAT. I P I C K ED € . V U R T U R N . 



WHERE DO VOU WISH TO FIRE YOUR MISSILE? 11 
VOU GOT ONE OF MV OUTPOSTS. 
ONE DOWN THREE TO GO 



I GOT VOU. IT WON'T BE LONG NOW. POST 25 WAS HIT. 
VOU HAVE ONLV THREE OUTPOSTS LEFT 



WHERE DO VOU WISH TO FIRE VOU* MISSILE? 12 
HA, HA VOU MISSED. MV TURN NOW 



I MISSED VOU, VOU DIRTY RAT. I PICKED 1 . YOUR TURN. 



WHERE DO VOU WISH TO FIRE YOUR MISSILE? 13 
HA, HA VOU MISSED. MV TURN NOW 



I MISSED VOU, VOU DIRTY RAT. I PICKED 21 . YOUR TURN. 



WHERE DO VOU WISH TO FIRE YOUR MISSILE? 14 
HA, HA VOU MISSED. MV TURN NOW 



I MISSED VOU, VOU DIRTY RAT. I PICKED 8 . YOUR TURN. 



WHERE DO YOU WISH TO FIRE YOUR ^MISSILE? 15 
VOU GOT ONE OF MV OUTPOSTS. 
TWO DOWN TWO TO GO 



I MISSED VOU, VOU DIRTY RAT. I PICKED 11 . YOUR TURN. 



WHERE DO YOU WISH TO FIRE YOUR MISSILE? 16 
HA, HA VOU MISSED. MV TURN NOW 



I MISSED VOU, VOU DIRTV RAT. I PICKED ? . YOUR TURN. 



197 



WHERE DO YOU WISH TO FIRE YOUR MISSILE? 17 
HA, HA VOU MISSED. MV TURN NOW 



SLOTS 



SLOT MACHINE 

Description 

The slot machine or one-arm bandit is a mechanical device that 
will absorb coins just about as fast as you can feed it. After 
inserting a coin, you pull a handle that sets three independent 
reels spinning. If the reels stop with certain symbols appear- 
ing in the pay line, you get a certain payoff. The original 
slot machine, called the Liberty Bell, was invented in 1895 
by Charles Fey in San Francisco. Fey refused to sell or lease 
the manufacturing rights, so H.S. Mills in Chicago built a 
similar, but much improved, machine called the Operators Bell. 
This has survived nearly unchanged to today. 

On the Operators Bell and other standard slot machines, there 
are 20 symbols on each wheel but they are not distributed 
evenly among the objects (cherries, bar, apples, etc.). Of 
the 8,000 possible combinations, the expected payoff (to the 
player) is 7,049 or $89.11 for every $100.00 put in, one of the 
lowest expected payoffs of all casino games. 

In the program here, the payoff is considerably more liberal; 
indeed it favors the player by 11% — i.e., an expected payoff 
of $111 for each $100 bet. To approximate Nevada odds, reduce 
the jackpot to $15 and keno to $4. 

Source 

Lots of slot machine programs were submitted including a very 
nice one by Rob Hof fberg of Roslyn, NY. The author of the 
one published is unknown. 




198 



PROGRAM LISTING 



■1 



100 RANDOMIZE 

110 DIM D<3> 

120 PR I NT "THIS IS ft SIMULATION OF A SLOT MACHINE USING A COMPUTER " 

130 PRINT "EACH TIME YOU 'PULL-' I WILL ASK YOU IF YOU WISH TO PLAY AGAIN. 

II 140 PRINT "JUST ANSWER WITH A ' V FOR YES OR A •' N' FOR NO. " 

II 150 PRINT "PLEASE PLACE 4 QUARTERS ON MY CPU FOR EACH PLAY. " 

fj 160 PRINT 

I 170 FOR Bl=l TO 3 

fj 180 LET D<B1>=INT<RND<0)*6)+1 

I 190 NEXT Bl 

|i 260 FOR Gl = l TO 3 

f] 210 IF D<61>»1 THEN 288 

|| 220 IF D<"G1>=2 THE N 30© 

f! 230 IF D<G1>=3 THEN 320 

}| 240 IF D(G1>*4 THEN 340 

|| 250 IF D<G1>=5 THEN 360 

fj 260 IF D<G1)=6 THEN 380 

fj 270 GOTO 580 

I 280 PRINT TAB<Gl+7>.; " BELL"; 

I 290 GOTO 390 

I 300 PRINT TAB<G1*7>.; " BAR".; 

$ 310 GOTO 390 

i-; 320 PRINT TAB<G1*7>; "CHERRY".; 

|| 330 GOTO 390 

fj 340 PRINT TAB<G1*7>.; "APPLE"; 

|| 350 GOTO 390 

fj 360 PRINT TAB<G1*7>; "LEMON".; 

fj 370 GOTO 390 

*| 380 PRINT TAB<G1*7>; " *"; 

j 390 NEXT Gl 

r | 400 PRINT TAB<28>; 

j 418 IF 'D<l)OD<2> THEN 440 

( 420 IF D<2>=D<3) THEN 530 

| ' 430 IF D<1)=D<2) THEN 460 

ij 440 IF DciXODO) THEN 490 

J 450 GO TO 510 

468 IF D<l>/20INT<D<l>/2> THEN 510 

| 470 LET B=B + 5'\PRINT "KENO. . YOU WIN *5. . TOTAL=*"; B; 

j 486 GO TO 550 

[ 498 LET 6=B-1\PRINT "YOU HAVE LOST *1 — TOTAL=*".; B; 

I 508 GOTO 550 

j 510 LET B=B+1\PRINT "YOU HAVE WON *1 — TOTAL=*"; B; 

! 520 GOTO 550 

I 530 LET B = B + 20\PRINT CHR*<7 >; "JACKPOT. .. *20. .. TOTAL=*".; B; CHR*<7>; 

540 GOTO 550 

'! 550 PRINT "AGAIN?"; 

j 560 INPUT *ft'\PRINTMF A=#V THEN 160SIF AO#N THEN 56© 

570 PRINT" IT'S BEEN NICE OPERATING FOR YOU COME BACK SOON!" 

J 580 END 

SAMPLE RUN 



I THIS IS A SIMULATION OF A SLOT MACHINE USING A COMPUTER ' 

| EACH TIME YOU 'PULL' I WILL ASK YOU IF YOU WISH TO PLAY AGAIN. 

|| JUST ANSWER WITH A 'V' FOR YES OR A ' N' FOR NO. 

j PLEASE PLACE 4 QUARTERS ON MY CPU FOR EACH PLAY. 

■;}- ■ ■ ' ' .'■■■■' ■ • ' • 

| BELL APPLE BELL YOU HAVE WON *i TOTAL=* 1 AGAIN?V 

I APPLE APPLE CHERRY KENO. . YOU WIN *5. . TOTAL=* 6 AGAIN?V 

I APPLE APPLE APPLE JACKPOT. .. *20. .. TOTAL=* 26 flGRIN?V 

j APPLE BAR APPLE YOU HAVE WON *1 TOTAL=* 27 AGAIN7V 

* * CHERRY KENO. . YOU WIN *5. . TOTAL=* 32 AGAIN2V 
BELL LEMON CHERRY YOU HAVE LOST *1 — TOTAL=* 31 AGAIN2V 

* CHERRY * YOU HAVE WON *1 — TOTALS* 32 AGAIN2V 
APPLE * BAR YOU HAVE LOST *1 — TOTAL=* 31 AGAIN2V 

* CHERRY BELL YOU HAVE LOST *1 — TQTAL=* 38 AGAIN2V 
CHERRY BELL BELL YOU HAVE LOST *1 — TOTAL=* 29 AGAIN2V 

BAR LEMON BELL YOU HAVE LOST *1 — TOTAL=* 28 AGAIN2V 

: * CHERRY CHERRY YOU HAVE LOST *1 — TOTAL=* 27 AGAIN2Y 

BELL BELL BAR YOU HAVE WON *1 — TOTAL=* 28 AGAIN?V_ 

* LEMON APPLE YOU HAVE LOST *1— TOTAL = * 27 AGAIN2V 
LEMON CHERRV BAR YOU HAVE LOST *i — TOTAL=* 26 AGAIN2V 

BAR APPLE BAR YOU HAVE WON #1 . TOTAL=* 27 AGAIN?V 

CHERRY LEMON CHERRV YOU HAVE WON *1 TOTAL=* 28 AGAIN2V 

BELL * LEMON YOU HAVE LOST *1 — TOTAL=* 27 AGAIN2V 

BELL LEMON LEMON YOU HAVE LOST *1 — TOTAL=* 26 AGAIN2V 

BELL LEMON LEMON YOU HAVE LOST *1 — TGTAL=* 25 AGAIN?V 

CHERRY CHERRV * YOU HAVE WON *1 — TOTAL=* 26 AGAIN2N 
IT'S BEEN NICE OPERATING FOR YOU COME BACK SOON! 



199 



SNOOPY 



PICTURE OF SNOOPY 



Description 

There must be 7,000 various computer pictures of Snoopy around 
dating from the ENIAC I. Just why Snoopy was universally 
adopted as the programmers 1 mascot is hard to say, but it's 
clear today that he was- -overwhelmingly! Here are a couple 
of pictures of that ubiquitous dog. 



* * 

* * 



* * * 

* * * 

* * * * 

* * * * 

* * * * * 

* * * * * 
****** 
****** 
******* 
******* 
******** 
******** 

******* 

******* H 

****** 4 

****** < 

***** 4 

* * * * * J 

****•) 

* * * 1 

* * * < 
* * 



***#*• 



• * * * * 



!•***** 



* * * * * * 

•*** ***** 

* * * * * 

* * * * 



* * 



xxxx 

X XX 

X *** X >c xxxxx 

X ***** X 3t **xxx XX 

1?XXXX ******* XXX XXXX XX 

xx x ****** xxxxxxxxx XX XXX 



XX X ♦*** X 

X XX XX 

X //XXXX 

X // X 

X // X 

X XXX// X 

X X X X 



X** X 

x***x 

XXXX 



xxxxxxxxxxxxxxxxxx/ 



X X 



XX 



XXX 



XX 



XXX XX 
( XXXX 

X XX X XXXX 

XXXXXXXX\ XX XX X 

X X XXX 

X XXXX XXXXXX/ X XXXX 

xxx XX*** X X 

XX XXXXX XX XXXX* * X X 

«-..* XXX 
*-* * XXX X X 

*- * XXX X 

*- *X XXX 

*- *X X XXX 

*- *X X XX 

*. *xx X x 

♦ *x* xx x 

* *X * X X X 

* * X** X XXXX X 

* * X** XX X X 

»* x** X XX X 

** X* XXX X X 

XX XXXX XXX 
XXXX X X 

xxx 

Bsia******* * * X X XXXXXXXX\ 

* * * /xxxxx XXXXXXXXN ) 

"III********** * X ) \ ) 

**««* * X \ \ jxxxxx 

■«•>>*+*+**+**+ xxxxxxxxxxxxxxxxxxxxxx 



CURSE YOU, RED BARONJ 



200 



SPACWR 



SPACEWAR BASED ON STAR TREK 



Description 



This program is an incredibly complete version of spacewar. 
You are Captain Kirk of the Starship Enterprise and have as 
your mission to destroy a certain number of enemy Klingon 
spaceships (generally around 24) and thus keep the galaxy safe 
for democracy. You must complete your mission in 30 stardates 
(measure of time in space — -think of it as a day). 

The galaxy is divided into 64 quadrants arranged in an 8x8 grid. 
Each quadrant is in turn divided into 64 sectors, also in an 
8x8 grid arrangement. It, of course, costs time and fuel to get 
from one quadrant to another. 

Complete playing instructions are given if you answer YES to 
the question, DO YOU WANT INSTRUCTIONS? 

Note: This program appears to have one or two minor bugs. It's 
eminently usable, but occasionally funny little things happen. 

Program Author 

Slightly modified by Mary Cole from the original written by: 

Mike Mayfield 
Centerline Engineering 




*®> 



9 



o 



O.Aht 



201 



11? 
120 

13? 
17? 
180 
200 
?1? 
229 
230 
240 
26? 
290 
30? 
360 
370 
38? 
390 
400 
410 
420 
430 
440 
4S0 
460 
470 
480 
49(1 

500 

510 

520 

530 

540 

550 

560 

580 

610 

640 

660 

670 

660 

70a 

72? 

730 

740 

750 

76« 

770 

775 

780) 

790 

800 

810 

820 

830 

640 

850 

860 

870 

880 

890 

900 

910 

920 

930 

940 

950 

970 

97! 

980 

9991 

1000 

1010 

A 020 

1030 

1031 

1040 

1050 

1060 

1070 

1080 

1MB 

1120 
1130 
1131 
1140 
1170 
1180 
1.190 
1200 
1201 
1210 
1240 
1250 
1260 
1270 
1290 
1291 
1292 
1293 
1294 
1295 
1296 
1297 
12S8 
1.310 
1320 
1330 
1340 
!350 
1360 
1370 
1380 
13?0 
1400 
1401 
1410 
14?0 
1440 



REM *** PROGRAM SIMULATE* XV. PROGRAM STARJREK „ „ , . 

REM **♦ WRITTEN BY MTKF MAyFIEI.D, CENTERLINE ENGINEERING/ , , t 

REM *** DEBUGGING AND MINOR BEyiSIONS BY LEO LAVFRDURE. IRA PflTEL. 

REM *** MARY COLE. AND DAVE AHL OP DIGITAL 

RANDOMIZE 

PRINT ...... „ * * * STAR TREK *,,« *'»iPRINT 

INPUT "DO VOU WANT INSTRUCTIONS 'fTMEYtRE LONG11"IA» 

IF.ASo*yE8» THEN 230 

GOTO 5820 

REM *** PROGRAM BEGINS HERE 

Z$.RR,9M« , „ ....„,, 

DIM G(8 # 8).Cf9.2).K(S,J).Nf31.7<:8,8} 

10. T«lNTfRNDf 1.1*20*20)* 100 

T9f30|O0«0iE0.f«3000|P0,P»l"0i8J»?0ffis l H8»0 

DEE FNntOliSORf fKf 1.1) -sT)**2*fKf 1.21 »82 1**21 

01»INTfRNDfl)*8*i) 

02»INTfRNDji1*8*l) 

SlBlNTfRNDfll*?*!) 

S2«INTfRNDfl1*8*l) 

T7«TTMEf0) 

ef2.i).Cf3.n.CM.i);c'r4 A 21.r*(5.2)rC( , 6.21*-l 

C ! i. 1 ) *Cf 3*21, C f 5. D.Cf7 # 21.C(f 9.1)b0 

Cfl.2).Cf2.21.Ci;6,n.Cr7.n.r(«.i).Cf8.21.c'f9.3!)«! 

MAT D»7ER . . 

D8»»WARP ENGINESS'.R. SFNP0R3L".R f . SPNSOPSPHASER CNTRL" 

Pl«D**"PHOTON TUBESDAMAGF CNTRl" 

E8»»3H!El.D CNTRLCOMPUTFR" 

89.K9-0 

REM *** SETS UP WHAT EXISTS IN GALAXY 

FOR I«1T08 

FOR J#J>08 

Rl-RND/11 . 

IE Rjl>l96 THEN 580 

IF Rl>,95 THEN 610 

IF RIP. 8 THEN 640 

K3-0IGOTO 660 

K3«3Jk9pK9+3*GOT0 660 

K3p2iK9«K9*2iG0T0 660 

K3«llK9»K9+l 

PURND/11 

IE RIP. 96 THEN 700 

B3«0 ( lGOTO 720 

P3«llB9*R9+l 

S3fINTfRNDM1*8*h 

G ( J . J) «K3* 1 0P*B3* 1 0*83 

7fI.J)«0 

NEVT J 

NEXT I 

K7«K9 

PRlNTiPRINT 

PRTNT»YOU MUST_DE3TR0Y»K©" K( IMQONS TN"T9« STARDATFS WITH "89 

IP B9>0 THEN 810 " STABBASES" 

fif6.3)«ri4 

K3.B3.«S3«0 

IF OKI OR Q!>fl OR Q2<1 fIR 09*8 THEN 990 

XbG(O1.Q2)*.01 

K3«IWTfX1 

53* I NT f itX«K31*!01 

S3"G(Q1 .O21»iNT(Gl!Gi,Q9)#.lW10 

IF K3b0 THFN 910 

I.F.S>2<*0 THEN 910 

PRJNT«COMBAT APEA CONDITION RED" 

PRINT" SHIELDS DANGEROUSLY LOW" 

MAT KbZER 

FOR IMT03 

*ff.3)B0 

M EXT..I 

OSbZ*|R$»ZS 

8$«MTDfZS. 1.481 

REM ** + PUT ENTERPRISE SOMEWHERE 

A$«h**>» 

71 ■SI* 

72*89 

GOSUR 55T0 

Fop I"1tok3 

GOSUB 5380 

REM *** PUT KLTNGONS 30MEWMERE 

A$bH+*+« 

71 »R! 

72?R9 

GOSUB 5510 

KfT.1)«Rll KfI.2)»R2l KfT.M*S9 

NEXT I 

FOP IMT0B3 

GOSUB 5380 

REM *** PUT STARBASEfSl SOMEWHERE 

A§«»M««'i 7l«R1i Z2bR2 

G08UB 5510 

NEVT I 

FOP !»1T0S3 

GOSUB 5360 

BEM *** PUT STARS SOMEWHERE 

AS*" * «t 71«R?i Z2«R2 

GOSUR 5510 

NEXT I 

GOSUB 4*20 

INPUT «COMMANDi«IA 

IF Ab0 GOTO 1410 

IE A*l GOTO 1260 

IF A»2 GOTO 93*0 

IF A«3 GOTO 9530 

IF A*4 GOTO 260?/ 

IF A»5 GOTO 3460 

IF A>6 GOTO 35«0 

IF A«7 GOTO 463.0 

!F V A»8 GOTO 6510 

PRJNT|PRINT» .0 ■ SFT COURSE" 

SHORT RANRE SFN80R SCAN" 

LONG RANGF SENSOR SCAN* 

FIRE PHA3FRP.B 

FTRE PHOTON TORPEO0E8" 

SHIELD CONTROI > 

DAMAGE C0NT90I REPORT" 

CALL ON LIBRARY COMPUTER" 

END THE C0NTEST"|PRINT 



PRINT" 

PRINT" 

PRJNT« 

PRINT" 

PRINT" 

PRTNT" 

PRINT" 

PRINT" 

GOTO 1270 

REM *** COURSE, CONTROL CODE REGIMS HERF 

INPUT "COURSE ri-9)l»iri 

IF C«»0 THEN 1270 

IF C!<! OR Cl>9 THEN 141P 



202 



|4M 
147f 

Jt4|0 
1490 
1500 
1510 
1520 
.1530 
1540 
1550 
1,560 
15?0 
1580 
1590 
1.600 

in? 

1611 

1630 
1640 
1680 

1«80 
i«70 
1880 
l«g0 
1710 
1720 
1760 
i>80 
1780 
17§0 
1810 
1650 
I860 
1870 
1890 
1^00 
1910 
19-10 
1950 
1970 
1980 
1990 
2000 
2010 

?0?0 

2030 

2040 

20?0 
2080 
2110 

2190 
2140 
2180 
2160 
2170 
2190 
2230 
2240 
2260 
2270 
2290 
2310 
23?0 
2321 
2330 
2340 
2360 
2370 
2380 
2390 
?400 
2410 
2420 
2430 
2440 
2450 
2460 
2470 
2471 
2480 
2490 
2500 
2501 
2530 
2540 
2560 
2570 
2580 
2590 
26?0 
2620 
2630 
2640 
2650 
2660 
2670 
2680 
2690 
2700 
?710 
2720 
2721 
2740 
2750 
2760 
2770 
2780 
2790 
2791 
2820 
2810 
2820 
2830 
2840 
2850 
2860 
2880 
2890 
29|0 
1910 



INPUT ?WARR EACTOR f0-?)!"iWl 

IF WJ40 OR Wl»8, THEN 1410 

XF V D(1)>»0 OR Wl««,2 THEN 18*0 

PRINT "WARP ENGINES ARE OAMAGEO. MAXIMUM SPEED ■ WARP *2« 

GOTO ,1410 .. m 

IF K3«P0 THEN 1560 

GOSUB 3790, 

IF K3««0 THEN 1560 

IF S«0 THEN 4000 

SOTO. 1810 ., ..„ 

If E»0 THEN 1610 

I.F.S<1, THEN 39?0 

RRINf "YOU HAVF"E" UNITS, OF ENERGY" „ ,, „ . 

PRINT ^SUGGEST YOU GET SOME FROM YOUR SHIELDS WHICH HAVE«S" UNITS L 

GOTO, 1270 , , 

FOR lilTOSf lF»Dn)»P0 THEN 1640 

REM *** FIY ANY DAMAGEO DEVICE 

DfT)«DfI1*i 

NEXT I 

IF RNDfl1>,2 THEN. 1810 

Ri»INT^RNDCl)*S*l) 

!f.RND(l)PE.,5_THEN 1750 

Of Rl l»DfRlV«fRNDf 11*5*1) 

PRTNTiPRINT "DAMAGE CONTROl' REPORTi"» 

GOSUB 56j0 w . ■ ' . 

PRINT" DAMAGED"|PRlNTpG0TO 1810 

DfRl)iDfRl5*fRNDfl1*5*T) 

PRTNTiPRINT "DAMAGE CONTROl' REPORTl"! 

GOSUB 5610 

PRINT" STATE OP REPAIR IMpROVED«iPRINT 

N»INTfWl*81|A$»B "iZ1«S1iZ2pS2 

GOSUB 5510, :._,-. 

yi «c rci . 1 ) + if c cci + 1 . n -0 f 01 ; n ) * rci iiNT rcT) 1 

Xi81|Y«82 , . . . . ,.._ ...-...,- 

Xl«C;C1.f )*(C(01*1.11«Cf?1.11)*fCl 7 INTfCl)1 
X2»CfC1.2)*fCfCl + l i 21«.f fCl«2n*fClwINTfCl)1 
FOR I*JT0NtSJ,i8i*XllS2«8?*X2 , . 
IF 3|«! OR 81>*9,0R S2<1 OR S2p»9 THEN 2170 
S8"S!*24*89*3«96! IF S8>72 THEM 1990 
IF MTDfOS.S8.3lB" " THEN 2070 
GOTO 2030 

IF S8M44 THFN 2020 
IF MTDfR*.S8«79.3)»« » THEN 9070 
GOTO^203? 

IF MIDfS*. 88-144. 31b" « THEN 2070 

PRINT»WARP ENGINES SHUTDOWN AT SECTOR «31«."S2" OUF TO BAD NAVAGATI 
S1b81«.X1iS2«S2"X2iG0T0 2«80 
NEXT I 

AS«»*#>"izi«SliZ2«S2 
GOSUR 5510 w . . 
EpE*N*5iIF WK1 THEN 2?5» 
T«t*{ 

IF T»T0*T9 THEN 3970 
GOTO 126P „ . . 
X*01*8*X*X1*N|V«92*8*Y*X?*N 

0! BlNTfX /81102b INT (Y/8USi«INTfX-Q1*8) I S2»TNT(Y*02*B1 
IF S t 1<>0,THEN 2260 
01"Gi'*IiS1b8 
I.F 89<»0 THEN 9290 
52*Q2»lrS2B8 
TbT*1iEbF»N+5 
IF T>T0 ♦ T9 THEN 3970 
GOTO 810 

REM *** LONG RANGE 8EN.80W 8CAN CODE PEGINS HERE 
IF D*f31>B0 THEN 2370 

PRTNT "LONG RANGE SENSOR* ARE INOPERABLE" 
GOTO 1270 ., . „ _ 

PRINTH^ONG RANGE. S?NSOR SCAN FOR QUADRANT "91 «.»02 , 
PRTNT"-— »-»——.— *»i».H 
FOR IbOI^I TO 01*1 
MAT NbZEP 

FOR J«02«l TO 02+1 

IF I«l OR T>8 OR J<1 OR 1t»P THEN 2460 
Nf.T«»02*21»GfI.J) 
IF Df71«0 THPN 2460 
7(1. ■J)mdtUJ'\ 
NEXT. J 

Pi*i»| UUti % ««# 1 a mm i« 
PRINT USING Plf,Nn)«Nf21.Ne3) 
PPTNTB— — — — »-- - — --^-» 
NEXT I 
GOTO 1270 

REM *** PHASER CONTROL CODF PEGINS HERF 
IF K3*b0 THEN S670 
IF Df41>B0 THEN 2570 
GOTO 1270 

IF Df71>B0 THEM 2590 

PRINT " COMPUTFR.FAILURE„HAMPERS ACCURACY" 
PRINT"PHA8FRS LOCKED ON TAR6FT- ENERGY AVAli'A8LFB«E 
INPUT "NUMBER OF UNITS TO EIREi"IX 
IF X«»0 THEN 1270 
IF. E-X<0 THEN 9570 
E»E«X 

GOSUB 3790 

TF Df71>»0 THEN 2680 
yBy*RND(l) 
FOR T«?T03 

IF„K>I.31<B0 THEN 2770 
HB!NT(fX/K"VFNOC0))*f2*RND?1111 
Kfi,3)BKfI.31«H 

PRINTH" UNIT HIT ON KLTNOON AT SECTOR 
PRINT" f"Kf -T.3.J" LEFT1" 
IF Kfl.31>0 THEN 2770 
; GOSUB 3690 
TF K9««0 THEN 4040 
NEXT I 

IF E*0 THEN 4000 
GOTO 1270 

REM *** PHOTON TORPEDO CODE PEGINS HPRF 
IF.D*f81>B0;THEN 2830 

PRINT "PHOTON TUBES ARE NOT OPERATIONAL" 
GOTO, 1270 
IF P»0 THEN 2860 

PRTNT "ALL PHOTON TORPEDOE* EXPENDED" 
GOTO. 1270 ,. 

input "torpedo course >i-9ii"ici 

IF C1«0 THEN 1270 

IF C1«l OR C«>*9,THEN ?880 

xi«cjci.i)*fCfci*i.n-c(ci.ii)*'( , ci-iNTfc.i)i 

X2.Cf CI »2)+(Cf 01*1.21-0(01. 21 )*fCl-INTfC1)1 



KfI.11".«K(T.2)l 



2920 Xf31iYi0?iR»R»l 4440 

£030 PRJNT "TORPEDO TRACKl" 

I960 X*X*XllYPY*X2 . . „, 

?900 IF X«l OR X»«9 OR V<! nR w y»»9 THEN 3420 4450 

29g0 PRINT" "X".»Y 4485 

30$0 A«?" "izT*X|72«iY 

3040 GOSUB 5080 

3050 JF Z3i0 THFN 3*70 4460 

30(10 GOTO 2960 „ 4405 

30?0 At'»»***»fZtiitiT2«Y 

3100 GOSUB 5680, 

3110 XF Z3f0 THFN 3220 4**0 

3120 PRINT »*** KLINGON DESTROYED ***" 4475 

3130 £3«K3-*lii<9§K9«J 

3150 IF/K9«?0 THEN 4040 w , „ 

3160 FOR T*JT03HF TNTmoK(T, 15 THEN 3190 4476 

3100 IF INTfYltKifI.25 THEN 3200 4460 

3190 Nf5J?T I , . .. . 4485 

3200 K(I.3)«0l6p.TO 3300 

3220 AS«" * »iZl«X|72»Y 

3230 GOSUB 5660. 4406 

3260 IF Z3«0 THFN 3?90 ' . . - ... - 44 * 

3,270 PRINT "YOU CAN'T DESTROY STARS. SILLY" 4495 

3200 §OTO 342? w , 

3290 AS«*»l*«tZl»Xl72«Y 

3320 GOSUB 5660. 4500 

3330 IF,Z3»0 THFN 2000 . , «,.#.#.■•■ ■ - „ 45tS 

3340 PRINT "*** STAR BASE DESTROYED *** ...... .CONGRATULATIONS" 

3350 B3«B3-1 , _ . 4510 

3300 ASf" MZ1«X|72«Y 4515 

3390 GpSUB 5510 

3400 G(Q1.Q25«K3*100+B3*10*S3 

3410 SOTO, 3430 45?0 

34?0 PRINT "TORPEDO MISSED" 4530 

3430 GOSUB 3790 4020 
3440 IF E«0 T"EN 4000 4630 
3450 SOTO 1270 4640 

3431 REM *** SHTELD CONTROL CODF RE6IN3 HFRF -?660 
3460 IF Df71>«0, THEN 3490,, 4000 
3470 PRINT "SHIELD CONTROL TS NAN-OPERATIONAL" 4001 
3400 GOTO 1?70 4602 
3490 PRINT "ENERGY AVAILABLF f"P*S| 4690 
3500 INPUT » NUMBER OF UNTTS TO SHIELD3t"»X 47|0 
35J0 IF X«P0 THFN 1270 Wl* 
3520 IF E*S-X<0 THEN 3490 47?0 
3330 FbF*S"XiS«* 4730 

3550 GOTO 127« . 4731 

3551 REM *** DAMAGE CONTROL RFPORT CODE 0FCTNS MERE 4740 
3560 IF Df6l>«0 THEN 3590 , . 4760 
3370 PRINT "DAMAGE CONTROL REPORT IS NOT AVAILABLE" 4770 
3560 GOJO J270 4700 
35§0 PRINTlPRTNT "DEVICE STATE OP REPAIR" 47fQ 
36J0 FOR R1"1T08 4795 
3020 GOSUB 36?0 

3630 PRINTDfRt) 4000 

3040 NEXT RltPRTNT 4010 

3660 GOTO 1270 ■ . . . 4020 

3670 PRINT«SHORT RANGE SENSORS REPORT NO KLINGONS IN THIS QUADRANT" 4821 

3680 GOTO 1270 ..--..' 4030 

30§0 PRINT "KLINGON AT SECTOR "K (T , 15 " . "K f I .21 "OESTROYEO ***" 4040 

3710 K3«K3p.1iK9»K9.i"|A$«« « iZ?»K (T . 1 5 iz?"K ( T , ?5 4050 

3760 G08UR 5510 4051 

3770 GfOl.Q25i»K3*100*B3*10 + «3 4060 

3700 RETURN 4070 

3790 IF CS<>"DOCKED« THEN 3*2* ... 4080 

3800 PRINT "STAR BASE SHIELDS PROTECT T«E ENTFRPRTSF" 4881 

30J0 RETURN ., 49g}0 

3020 IF K3<«0 THEN 3910 4910 

3030 FOR I«1T03iIF K(I.35««a THFN 3900 4920 

3050 H«INT(fK?lj3VFNDf05Ur2 + RNDfnniS»S*H . 4960 

3670 PRINTH" UNTT HIT ON ENTERPRISE AT SECTOR "K ( T . 1) " . »K 1 1 .21 1 4970 

3871 PRINT" ("S" LEFT1" 4990 

3890 IF S*0 THEN 40010 3010 

3900 NEXT I S030 

3910 RETURN , '■.„.'.- .._,.. .... 3031 

3920 PRINT "THE ENTERPRISE TS DFAD TN SPACE. IF YOU SURVIVF ALL IMPENDING" 5050 

3930 PRINT "ATTACKS YOU WILL RE DFMOTFD TO THE RANK OP PRIVATE" ,5051 

3940 IF K3<»0 THEN 4020 5070 

3950 GOSUB 3790 5000 

3960 GOTO 3940 5005 

3970 PRINTlPRTNT "IT IS STARDATP«T 5090 

3990 GOTO 4»20 . 5100 

3991 REM *** NO ENERGY LEPT ' . , . . ,, 5110 
4000 PRJNT»PRINT"THF ENTERPRISE HAS BPEN DESTROYED., THF FEOERATION WILL BE 5120 
4020 PRINT "THERE ARE STILL "K9» KLTNGOM RATTLE CRUISERS" CONQUERFD" 5130 
4030 PRINT|PRTNT|PRTNT|PRTNT "YOU GFT ANOTHFR CHANCF. .„ . . » IGOTQ 230 3140 
4040 PRfNT|PRTNT"THF LAST Kl'lNGON BATTLF CRUISER TN..TME GALAXY HAS SEEN 5130 
4050 PRINT«THF FEDERATION HAS BEEN SAVED! ! I ! 1 » fPRTNT DP3TR0YPD" 0170 
4075 E5«('(K7/fT-T055,*i0001 5i90 
4080 PRINT "YOUR EFFICIENCY RATING »»E5 , , . . . . 5200 
4100 PRINT"YOUR ACTUAL TIME OF MISSION ■"TNT ( f TTMP(05 -T7l /6«5 I " MINUTES" 5210 

4105 PRTNTlPRINTiPRTNT 5220 

4106 JNPUT«D0 YOU WANT TO TRY AGAIN«|R$ 5230 

4107 I'F.R* ■ "YFS" THEN 2S0 5240 

4110 GOTO 65101 5250 

4111 REM *** SHORT RANGE SENSOR SCAN AND STARTING POINT COOP 5260 
4120 FOR I«S1-1T0 S?*l 5270 
4130 FOR JPS2-1T0 S?*l 3280 
4140 IF HI. OR T>8 OR J<1 OP .TM THFN 420W 33|0 
4150 A$«»>n<"izi"T|72«J 5310 
4100 GOSUB 5680 5320 
4190 IF Z3«l THEN 4940 3321 
4200 NEXT J 5380 
4210 NEXT I 5450 
4220 D0«0lGOTO 4310 . _ 5440 
4240 D0«llCS""DOCKED"iE«3000lP"10 54§0 
4200 PRINT "SHIELDS DROPPED FOR DOCKING PURPOSES" 55*0 
4290 S««|GOTO 438« 5520 
43J0 IF K3>0 THEN 4350 5540 
4320 IF E«E0 *.? THEN 4370 5550 
4330 CS«"6REEN" 5560 
4340 GOTO 4360 5370 
4300 e$*»REO"iGOTO 4380 5500 
4370 C$»"YELLOW" s 5590 
4300 IF.D(2)>f0.THEN 4430 ..':..' 5600 
4390 PRINTlPRTNT"*** SHORT RANGF SENSORS ARE OUT ***»|PRINT 3610 

4420 GOTO 4530 .'. ... . . , 5620 

4430 OIS""—-----— ----—-*-»-----'•-— ----" 5640 

4430 PRINT USING flit 56 ? 

4440 02S"? VV\\\\\Vy^\V\\V\» 5870 



PRINT U0ING 025,MlDCO$ # l,3KMIDfOS.4 A 35,MIDfOS,7*3J. „ 

MIDitQS.10.35.MTDfQ«.13l3nMID'(e$,16.3).MIDfQS,19.35, 
, MI0'(0s722,3} 

OSSROas*! 1 STAROATE , ,#*###" .,,.., . .- 

PRINT USING 03S.MIDCQ$,25.3r,MTDfa*»2e*5l,MID(OS.3!.35. 

MIDf0S A 34.3)^MT0f0S.37r3\,Mlbi:0j74«.3); 

MIOfQS^S.Sl.MTDfQS^S.SV.T 
04IR02S*" .. CONDITION V \" „ , 
PRINT USING e4J.MID"fOs"49i3)*MIDf0S.52.31.MID(O$,39.3S 

MID{0S.58»3).MXDfQi.6r.31,MID(SS.64.3).MTDfQS.87.*35» 
, . MID(OS.70.3).CJ| „ 

03SP02S*" QUADRANT - ■ &* . . . ■ • -. .. 

PRINT USING 05J, MID'fR|»l,3\.aiD(RS.4 % 3?. MIDfRI«7, 3). „ 

MID(Ri 4 10.3).MIDfRS.13.31»MID(!RS.16,3).MlDfRS.19.31f 

MIDtRs.22.3).Ql| 
PRINT V"|Q2 

06»«02S*" .. SECTOR ... , «" . 
PRINT USING 06S.MlDfRS s 25.3)>TDfRS«28.31. . w ' 4 . 

MID (R8 4 3t, 3) iMTDfRt. 34731, MID eR$T37. 35. MTDfRS, 40.31. 

MlD(RS.43.35.MTDfRS.46.31.Sll 
PRI.NT " f "IS2 

07S«02S*" TOTAL.ENERGY . ##«#«*« „ ... m „ 

PRINT USING 07S.MIDfR$ s 49,35;MIDfRS.52.31.MIDfR$,53.35^ 

MID'fRS.58,35.MTD>R*.6ir31,MIDeR$.64,35.MT0fRS.67.*31» 

MID(Rsl70.35«E ...... 

O0StO2S*" PHOTON TORPEDOES ###" 

PRINT USING 0SS.MlbcS$7l,31.MIDfSs74.31.MIDfS$.7.3J.MID(SS.l 

MIDfSS.l3.35 7MTOf8S.?0731.MIDeS$.19.3).MTDfSS,22.31. 
09t*02* + " , ; .. SHIELDS, H****** „ . 

PRINT USING Ogs.MlD'fSS^S.SllMTDfSS^a.SI.MIDfSS^J.Sl. . 

MID'f"SS ft 34.35 7MTDCS«.37731.MIDfS$.40.31.MTDfSS.43.31. 

Miocss^e.si.s 

PRINT USING 01« 

RETURN 

REM *** LISRARY COMPUTFRCODF REGIES HFRF' " 

IF D'f61>»0 THEN 4660 

PRINT "COMPUTER DI0ABLFD" IGOTO 1?7« , . 

INPUT "CDMPUTER ACTIVE AND AWAITTNG COMMAND|»IA 

JF A«0 GOTO 4740 

IF A«l GOTO 4830 

IF A"2 GOTO 48S0 

PRINT "FUNCTIONS AVATLABJ E FROM COMPUTFR" 

PRJNT " ■ CUMULATIVE GALACTIC RECORD" 

PRINT « J ■ STATUS REPORT" 

PRINT » 9 m PHOTON TORPEDO DATA" 

GOTO 4660 . ■ ' 

REM *** CUMULATIVE GALACTIC RECORD CODE BEGINS HFRF 

PRINT"C0MPUTER RECORD OF GALAXY FOR QUADRANT "01". "02 

PRINT" 1 .2. 3 4. 5 .6. .7 8" 

PRINT" «.—»— — — mlm^m .... - *.... •••.. ..... .... ." 

FOR TMT08,_ \ ^ m , _ 
Nisv'ttfy nuu ### \ §itt una uhu ««* nun _**#" 
PRINT USING Nl J. 1,7(1, T)7Zfl72l. 7(1, 35.Zf 1.41. 7(1.35. Z>I. 61, 
. , .. 7(T.75.Z?Ie81 , 

print" ..... ..... ,:... ..... „.,.. ..... ----- ....." 

NEXT I 
GOTO 127« 

rem *** status. report code begins here 

print » status report" 

print "number of klingons i'eft *"k9 

V5«(T0+T95-T 

PRJNT "NUMRER OF STARDATFS LFFT «"IV3 

PRINT "NUMBER OF STARBASF8 LFFT ««R9 

GOTO 3560 

PRTNT|HS"0 

REM *** PHOTON TORPEDO DATA CODE BEGINS HERE 

FOR TMT03 

IF K(I.31<"0 THEN 5260 

ClBsilAtS2fw'l«K(I,i5ix«Kfl721 

GOTO 5010 ■' „ ' • to ,--.„-, 

PRINT"VOU ARE AT QUADRANT f »Q1"."Q2" 1 SECTOR f "si«.»S2" 

INPUT "SHIP ANO TARGET COORQINATFS ARE*I m »C1"/a, Wl ,% 

XiX*A|ApCl«W! . 

JF X<0 THEN 3130 

IF A<8 THEN 519P! 

IF-X»0 THEN 5070 

IF A«0 THEN 3150 

Cl«l 

IF AgSfAl <■ ARS^XI THFN 0?1« 

V3?C1*,f (fASSfA.1-ABS'(X5l*ABS(A51/ABS(A)1 

PRINT "DIRECTION «"V5 

GOTO 5240 ...'.,-, ,■■■■'' 

PRINT "DIRECTION ■"Cl*?APSfA1/ABS(X51 

GOTO 3240 

JF A>0 THEN 3170 

IF X»0 THEN 5190 

C1P5IG0T0 3080 

Cl*3iGOTO5?00 

Cl-7 , , . . 

iF.ASSf A1>«ABS.fX1 THEN S?3* 

PRINT "DIRECTION ■"Cl*f ( fA*S f X1-ABS ( A 5 1*ABS(X5 1/ABS(X5 1 

GOTO 5240 

PRJNT "DIRECTION »"Cl*fA«SfX1/ABS'(A51 

PRINT "DISTANCE »"SQR(X**2*A**25 

IF HS«1 THFN 5320 

NEXT I 

H8?0 

JNPUT "DO VOU WANT TO USF THE CALCULATOR" I AS 

IF A«i"YFS« THEN 4970 

IF A*O«N0" THFN 520« 

GOTO 1270 

REM *** END OF. LIBRARY COMPUTER CODE 

RlfINT(RNDhl*S*l5iR2«TNT(RND(T5*0+11lAS«» « iZ1 «R1 IZ2«R2 

GOSUB 5680 

IF Z3*0 THFN 5380 

RETURN ....... 

REM *** INSERTION IN STRTNO ARRAY FOR QUADRANT *** 

S8»Z«.*24 + Z9*3«?6^IF S8>72 THEN 558« 

Q$fLPFT(Q$7s«"n*AS*RlSHT (OS. 88*35 

GOTO 5600 

IF S8M44 THEN, 5590 

RS|LPFT(R$.S8i.73UA$*RTGHTrR«,38»69 5 

GOTO 5600 

SS»LFFT(SS.S8«.T455iAS*RlGHT(S$7sB"V415 

RETURN 

REM *** PRINTS DEVICE NAME FROM ARRAY*** 

58"R1*12»11 IIF.S8>72 THEM 3660 

PRJNT MlO(OS.S8 f H1. »GQTO 3670 

PRINT MID(E$.SB»72,115. 

RETURN 



203 



5680 
5600 
57!>0 
5730 
5750 
5760 
5770 
5790 
5800 
5810 
5820 
5821 
58?2 
58S»3 
5830 
3840 
5850 
5870 
5880 
5890 
5900 
5910 
5920 
5930 
5940 
5950 
5960 
5970 
5980 
5990 
6000 
6005 
60f0 
6020 
6030 
6040 
6045 
6060 
6070 
6080 
6090 
6100 
6110 
61?0 
6130 
6140 
6150 
6160 
6170 
6180 
6190 
6200 
6210 
6220 
6230 
6240 
6250 
6251 
6260 
6270 
6280 
6290 
6300 
6310 
6320 
6330 
6340 
6350 
6360 
6370 
6380 
6390 
6400 
6500 
651*0 



REM ***STRING COMPARISON IN QUADRANT ARRAY*** 

88»ZJ*?4+Z?*3»?6»Z3"aiTF S8>72 THEM 5750 

IF MTDfO*,88.3W>A* THPN 5810 

73«l»GPTn «58[0 

IF 88>1 44 THFN 5790 

TF MTOfR*, 88-79. 3i<>A$ THEM 5810 

73-lfGOTft 5810 

TF MTDfS*. 88-144. 31<>A* THFN S'«l« 

73"1 

RETURN 

ft" INSTRUCTIONS" 

ft|ft«THF GALAVY.IS DIVIDED TNTO AN S.S OUADPANT GRID" 

RW.WHICW IS IN TURN DTVTDFD INTO AN fl.fl SECTOR GRID*." 

ft|ft"THE CAST OF CHARACTERS IS AS FOLLOWS*!" 

*««*» ■ FNTERPRI8E" 

ftn**.* « KLTNttON" 

»,»>!« « STARRASE"!* " * ■ STAR" 

R»COMMANO «■■ WARP ENGTNF, CONTROL I " 

ft" COURSE IS TN A CTRpui'AP NUMERICAL 4 3 2" 

ft" VECTOR ARRANGEMENT A* SHOWN. \ a /" 

ft" INTEGER AND REAL VALUE* MAY BE W« 

ft" USED. THEREFORE COURSF f> TS 5 — — 1" 

I" HALF WAY BFTWEEN 1 AND 2. /X\ « 



ft" 
*" 



ft" 



A VECTOR OF 9 IS UMDPFTNPD. 
VALUES MAY APPROACH 0.« 



RUT 



8« 



ONF WARP FACTOR TS T M E STZF Of" 
ONE OUADRANt'. THEREFORE TO GET" 

from quadrant 6.5 to 5.5 you w0(jld" 
usf course 3. warp factor i« 



ft"CQMMAND 1 ■ SHORT RAMG* SENSOR SCAWH 

ft" PRTNT THF OUADRANT YOU ARE CURRENT! Y IN. INCLUDING" 

ft" STARS. KLINGONS. STARBASFsT AND THF ENTERPRISE^ ALONG" 

M WITH OTHER PFRTINATE INFORMATION*. « 

ft|ft«COMMAND ? m LONG RANGE SFNSOR SCAN" 

ft" SHOWS CONDITIONS IN SPAeF FOR DNF QUADRANT ON EACH STDF« 

%» OF THE ENTFRPRISF TN THE MTDDLF OF THE SCAN. THE SCAN" 

ft" TS CODFD IN THE FORM XYX. WHFRF THF UNTTS DIGIT 1$ THE « 

t" MUMBFR OF STARS. THE T^NS DIGIT TS THE NUMBER OF STAR-" 

ft" PASES. THF HUNDREDS DTGTT IS THF MUMBFR QF KlTmGOMs'." 

ft|ft«CO M MAND 3 « PHASFR CONTROL" 

ft" ALLOWS YOU. TO DESTROY T H F KLTNftQNS BY MITTTNR HIM WITH" 

ft" SUTTABI Y LARGE NUMBERS OF PNFRGY UNITS. TO DEPLFTF HIS " 

ft" SHIELD POWFRl KFEP TN MTNf> THAT WHEN YOU SHOOT AT HIM." 

ft" HE GONNA SHOOT AT VO". TOO!" 

ft|ft«COMMAND A ■ PHOTON TORPEDO CONTROL" 

ft" COURSE IS THF SAME AS I'SFO IN WARP ENGTNF OONTRO! '..* 

ft" TF YOU. HIT THE Kt INGON^ HE IS DESTROYED AND' CANNOT FTRF" 

ft" PACK AT VOU. IF YOU MTS8. YOU ARE SUBJECT TO HIS « 

ft" PHASFR FTRF." 

ft*ft« NOTE! THE LIBRARY COMPUTER '("COMMAND, 7i HAS AN OPTTQN" 

ft" TO COMPUTE TORPEDO TRAJECTORY FflR YQIJ ("OPTION ?)'.» 

HtHWCOMMANn 5 ■ SHIELD CONTROL" 

ft" DEFINES NUMBER OF FNFRGY UNITS TO BE ASSIGNED TO SHIFLDS" 

ft" FNFRGY IS TAKEN FRDM_TOTAL SHIPIS FNPRGY*." 

ft" NOTE THAT TOTAL FNFRV TNCL.HDFS SHIFLD FNFRGyI" 

ft|ft«COMMAND 8 * DAMAGE CONTROL REPORT" 

ft" GIVES STATP OF RFPAIRS OF ALL DEVICES. A STAT? OF RFpAIR" 

ft" LESS THAN 7ER0 SHOWS THAT THF DEVICE IS TEMPORARALY" 

ft" DAMAGED." 

ft|ft»CO M MAND 7 « LIBRARY COMPUTER" 

ft" THE i IRRARY COMPUTFR, CONTAINS THREF OPTIONSV 

ft" OPTION 0b CUMULATTVF GAIACTTC RFCORD" 

HM WHICH SHOWS COMPMTFR MFMORY OF THE RFSHLTS" 

ft" OF ALL PREVIOUS i'ONG RANGE SENSOR SCANS" 

ft" OPTION 1 * STATUS REPORT" 

ft" WHICH SHOWS NUM8PR F KLTNGQNS. STARDATES." 

ft" AND STARBASES lEPT*." 

ft" OPTION 2_» pHOTQM TOPPFOO DATA" 

ft" GIVES TRAJECTORY AND OTSTANCF RETWFEM THE". 

ft" FNTERPRISE AND AIL Kl'lWGONS in YOUR OUAOPANT" 

GOTO 230 

FND 



SAMPLE RUN 

VOU MUST DESTROY 12 KLINGONS IN 30 STflROflTES WITH 



<*> 



RDflTES WITH 3: 


STARBASES 


STft'ROflTE 


23:00 


CONDITION 


GREEN 


QUADRANT 


2, :< 


SECTOR 


2, 6 


TOTAL ENERGV 


3000 


PHOTON TORPEDOES 


10 


SHIELDS 






COMMAND:? 2 

LONG RANGE SENSOR SCAN FOR QUADRANT 



104 



COMMAND:? O 
COURSE <l-9>:? 8 
WARP FACTOR <0-8> :? 1 
COMBAT AREA CONDITION RED 
SHIELDS DANGEROUSLY LOW 

+ + + 



STARDATE 


2301 


CONDITION 


RED 


QUADRANT 


2/ 4 


SECTOR 


2, 6 


TOTAL ENERGY 


299? 


PHOTON TORPEDOES 


10 


SHIELDS 






COMMAND:? 5 

ENERGY AVAILABLE = 299? 

COMMAND:? ? 

COMPUTER ACTIVE AND AWAITING COMMAND 



NUMBER OF UNITS TO SHIELDS:? 200 



DIRECTION = 4 

DISTANCE » 1. 41421 

DO YOU WANT TO USE THE CALCULATOR? NO 

COMMAND:? 4 

TORPEDO COURSE <l-9):? 4 

TORPEDO TRACK: 

1 , 5 
*** KLINGON DESTROYED *** 

COMMAND:? 6 
COURSE <l-9>:? ? 
WARP FACTOR <0-8> :? 3 



STARDATE 


2302 


CONDITION 


GREEN 


QUADRANT 


6, 4 


SECTOR 


2, 6 


TOTAL ENERGV 


2678 


PHOTON TORPEDOES 


9 


SHIELDS 


300 



COMMAND:? © 
COURSE <l-9> :? 2 
WARP FACTOR <0-8>:? 1 



STARDATE 


2303 


CONDITION 


RED 


QUADRANT 


5, 4 


SECTOR 


2, 6 



TOTAL ENERGY 2675 
PHOTON TORPEDOES 9 
SHIELDS 300 



COMMAND:? 7 

COMPUTER ACTIVE AND AWAITING COMMAND:? 2 

DIRECTION » 6 

DISTANCE = 4. 24264 

DO YOU WANT TO USE THE CALCULATOR? NO 

COMMAND:? 4 

TORPEDO COURSE <l-9>:? 6 

TORPEDO TRACK: 



4 , 4 

5 , J 
*** KLINGON DESTROYED *** 



COMMAND:? 9 

COURSE <l-9>:? 7 

WARP FACTOR <&-&> :? 1 

WARP ENGINES SHUTDOWN AT SECTOR 8 



1. 5 DUE TO BAD NAVIGATION 



STARDATE 


2307 


CONDITION 


GREEN 


QUADRANT 


?, 6 


SECTOR 


7, 1. 5 


TOTAL ENERGY 


2573 


PHOTON TORPEDOES 


4 


SHIELDS 


200 



COMMAND:? ? 

COMPUTER ACTIVE AND AWAITING COMMAND:? 

COMPUTER RECORD OF GALAXY FOR QUADRANT 7 , 

12 3 4 5 6 7 






5 


1 


7 

















8 


1 


2 

















4 


2 


104 

















1 


5 


5 

















7 


2 


5 


2 














7 


8 


5 


2 


8 


2 











1 


14 


6 


12 


6 














2 


5 


102 


8 






COMMAND:? Q 
COURSE <l-9>:? 3 
WARP FACTOR <&-&> : ? 5 



STARDATE 


2308 


CONDITION 


GREEN 


QUADRANT 


2, 6 


SECTOR 


7, 1 


TOTAL ENERGV 


2538 


PHOTON TORPEDOES 


4 


SHIELDS 


200 



COMMAND:? 2 

LONG RANGE SENSOR SCAN FOR QUADRANT 



: 6 : 


2 : 


3 : 


7 : 


12 : 


3 : 


4 : 


8 : 


8 : 



COMMAND:? 7 

COMPUTER ACTIVE AND AWAITING COMMAND: 

STATUS REPORT 
NUMBER OF KLINGONS LEFT = 6 
NUMBER OF STARDATES LEFT = 22 
NUMBER OF STARBASES LEFT = 2 



204 



DEVICE 
WARP ENGINE 
S. R. SENSOR 
L. R. SENSOR 
PHASER CNTR 
PHOTON TUBE 
DAMAGE CNTR 
SHIELD CNTR 



STATE OF REPAIR 



SPLAT 



OPEN A PARACHUTE AT THE LAST MOMENT 



Description 



SPLAT simulates a parachute jump in which you try to open your 
'chute at the last possible moment without going splat I You 
may select your own terminal velocity or let the computer do 
it for you. You may also select the acceleration due to gravity 
or, again, let the computer do it in which case you might wind 
up on any of the eight planets (out to Neptune) , the moon, or 
sun. 

The computer then tells you the height you're jumping from and 
asks for the seconds of free fall. It then divides your free 
fall time into eight intervals and gives you progress reports 
on your way down. The computer also keeps track of all prior 
jumps in the file PARACH.UTE and lets you know how you compared 
with previous successful jumps. 

Program Author 

John F. Yegge 

Oak Ridge Associated Universities 

Oak Ridge, TN 37830 




205 



1 958 by Editorial Projects, Inc. 



■«D1«FT* 

■ "V1''PT/SEC +-5X" 
«A2«FT/SEC/SEC + -5%" 



PROGRAM LISTING 

30 OPEN «PAR*CH,UtE» AS FILE IX 

40 DIM *U,A(4000) 

55 RANDOMIZE 

95 PRINT "WELCOME TO 'SPLAT' — THE GAME THAT SIMULATES A PARACHUTE" 

96 PRINT "JUMP, TRy TO OPEN yOUR CHUTE AT THE LAST POSSIBLE" 

97 PRINT "MOMENT WITHOUT GOING SPLAT," 

116 PrINt\PrINt\D1«0\v*0\A*0\N*0\M*0vdI«INt(9001*rNDC1)+1000) 

119 PRINT « SELECT YOUR OWN TERMINAL VELOCITY (YES OR NO)»>\INPUT A1S 

120 IF A1$""NQ« THEN 128 ELSE IF Ai$i«YES« THEN 123 

121 PrINt «'YEs' Or 'NO' PLEAsE«l\INPuT A1$\GQtO 120 
123 PRINT "WHAT TERMINAL VELOCITY (MI/HR) « I \INPUT VI 

125 Vi»Vl*(5280/3600)\V«Vl+((Vl*RND(0))/20)»((Vl*RND(0))/20)\GOTO 135 
128 V1«INTC1000*RND(0)) 

130 PRINT "OK, TERMINAL VELOCITY «"Vl"MI/HR" 

131 VI »V1* (§280/3600 )W ■VI* ((Vl*RND(0))/20)»((Vi*RND(0))/20) 

135 PRINT "WANT TO SELECT ACCELERATION DUE TO GRAVITY (YES OR NO)"? 

136 INPUT Bl» 

140 IF 8t$«"N0« THEN 150 ELSE IF Bl$«»YES" THEN 143 

141 PRINT ("YES' OR • NO t PLEASE" I \INPUT B1$\GQTQ 140 
143 PRINT "WHAT ACCELERATION (FT/SEC/SEC )» I \INPUT A2 
145 A«A2+((A2#RND(0))/20)*((A2*RND(0n/20)\GOTO 205 

150 ON INT(U(10*RND(0)))GOTO151,152,l53,i54,i5S,i56,157,l58,159,160 

151 PrINt«FINE. YOU'RE ON MERCURY. ACCELErAtIQN«12,2Ft/SEC/sEC"\G0t0161 

152 PRINT"ALRIGHT. YOU'RE ON VENUS, ACCELERATION'S . 3 FT/SEC/SEC»SG0T0162 

153 PRINT "THEN YOU'RE ON EARTH, 'ACCELERATIONS. 16 FT/SEC/SEC"\GOTO 163 

154 PRINTLINE, YOU'RE ON THE MOON, ACCELERATI0N«5, 15FT/SEC/SEC"\G0T0 164 

155 PRINT«ALRIGHT. YOU'RE ON MARS. ACCELERAT ION* 12. 5FT/SEC/SEC"\G0T0 165 

156 PRINT»THEN YOU'RE ON JUPITER, ACCELERATION«85.2FT/SEC/SEC"\G0T0 166 

157 PRINT«FINE, YOU'RE ON SATURN, ACCELERATIONS , 6FT/SEC/SEC»\GOT0 167 

158 PRINT"ALKIGHT, YOU'RE ON URANUS. ACCELERATIONS ,8FT/SEC/SEC"\G0T0 168 

159 PRINT"THEN YOU'RE ON NEPTUNE, ACCELERATI0N-39. 6FT/SEC/SEC"\G0T0 169 

160 PRINT«FINE, YOUtRE ON THE SUN, ACCELERATI0N«896FT/SEC/SEC"\GnT0 170 

161 A2«12,2\G0T0 145 

162 A2«28,3\G0T0 145 

163 A2«32.16\GQT0 145 

164 A2«5,15\G0T0 145 

165 A2«12.5VGOT0 145 

166 A2«85,2\G0T0 145 

167 A2«37,6\G0T0 145 

168 A2S.8 \GOTQ 145 

169 A2«39,6\G0T0 145 

170 A2«896\G0T0 145 

205 PRINT 

206 PRINT " ALTITUDE 

207 PRINT " TERM, VELOCITY 

208 PRINT " ACCELERATION 

210 PRINT "SET THE TIMER FqR YqUR FrEEFALL, 

211 PRINT "HOW MANY SECqnDS" J \lNPUT T 
215 PRINT "HERE WE GO," 

217 PRINT 

21s PRINT "TIME (SEC)", "DIST TO FALL (FT)" 

21 9 PRINT "iiniiiiii l, r >iiiciiiijitiiiiiiii 

300 FOR 1*0 TO T STEP (T/8) 

310 IF I>V/A GOTO 400 

320 D«D1»((A/2)*Ia2) 

330 jF D<«0 GOTO 1000 

340 PRINT I,D 

350 NEXT I 

360 GOTO 500 

400 PRINT "TERMINAL VELOCITY REACHED AT T PLUS" V/ A"SECONDS" ' 

405 FOR 1*1 TO T STEP (T/8) 

410 Db.D1-((Va2/(2 + A)) + (V*(X-(V/A)))) 

420 IF D<*0 GOTO 1010 

430 PRINT I,D 

440 NEXT I 

450 goto 500 

500 print "Chute open" 

510 K*0\K1*0 

530 FOR 1*1 TO 4000 

550 IF A(I)«0 GOTO 620 

560 K»K>i 

570 IF D>»A(I) GOTO 600 

580 K1«K1+1 

600 NEXT I 

620 A(I)«D 

630 1*1-1 

650 IF K-K1< B .1*K GOTO 700 

660 IF K»K1<«,25*K GOTO 710 

670 IF K-Ki<«,5*K GOTO 720 

680 IF K-Kl<s,75*K GOTO 730 

690 IF K-K1<«,9*K GOTO 740 

695 GOTO 750 

700 PRINT "wOwi THAT'S SOME JijMPlNG, OF THE«K"SuCCESSFuL JUMPS" 

701 PRINT "BEFORE YOuRS» ONLY"K-K 1 "OPENED THEIR CHUTES LOwER THAN" 

702 PRINT "YOU DID," 

703 GOTO 2000 

710 PRINT "PRETTY GooDJ " K"SUCCESSFUL JUMps PRECEDED YqURS AND' ONLY" 

711 PRINT K-Kl" OF THEM GQT LOWER THAN YOU DID.' BEFORE THEIR CHUTES" 

712 PRINT "OPENED," AGOTO 2000 

720 PRINT "NOT BAD, THERE HAVE BEEn"K"SUCCESSFUL JUMPS BEFORE YOURS." 

721 PRINT"YOU WERE BEATEN OUT BY H K«Kl"Op ' ' THEM. "VGOTO 2000 

730 PRINT "CONSERVATIVE AREN'T YOU? YOU RANKED ONLY"K-K 1 » I* THE" 

731 PRINT K"SUCCESSFUL JUMPS BEFORE YOURS,"\GOTO 2000 

740 PRINT "HUMPH J DON'T YOU HAVE ANY SPORTING BLOOD? THERE WERE" 

741 PRINT K"SUCCESSFUL JUMPS BEFORE YOURS AND YOU CAME IN»K 1" JUMPS" 

742 PRINT "BETTER THAN THE WORST. SHAPE UP Hi "\GOTO 2000 

750 PRINT "HEY1 YOU PULLED THE RIP CORD MUCH TOO SOON, "K»SUCCESSFUL" 

751 PRINT "JUMPS BEFORE YOURS AND YOU CAME IN NUMBER»K-K1» | GET WITH I T i » 

752 GOTO 2000 

800 PRINT "REQuIEsCAt IN PACE."\GOtO 1950 

801 PrIN T "May THE ANGEL OF HEAvEN LEAD YOU INTO PAraDIsE«\GOtO 1950 

802 prINt "REST IN pEACE"\GoTO 1950 

803 PRInT "SON-OP-A-GUN"\GoTO 1950 

804 PRINT "#$%&&%J$«\GOTO 1950 

805 PRINT "A KICK IN THE PANTS IS 

806 PRINT "HMMM, SHOULD HAVE PICKED A SHORTER Tim e ,m\ g0 TO 1950 

807 PRINT "MUTTER. MUTTER, MUTTER, "\GQTQ 1950 

808 PRINT "PUSHING UP DAISIES, "\GOTOl950 

809 PRINT "EASY COME* EASY GO,"\GOTO 1950 
1000 PRINT SQR(2*Di/A)#"SPLAT" 

1005 ON INT(1+(10*RND(0)))GOTO 800,801,802,803,804,805,806,807,808,809 

1010 PRINT (V/A)+((D1-(Va2/(2*A)))/V), "SPLAT" 

1020 GOTO 1005 

1950 PRINT "I'LL GIVE YOU ANOTHER CHANCE ."VGQTO 2000 

2000 PRINT "DO YOU WANT TO PLAY AGAIN" >\INPUT Z$ 

2001 IF Z$*"YES" GOTO 118 

2002 IF Z$""NQ" GOTO 2005 

2003 PRINT "YES OR NO»\GOTO 2000 

2005 PRINT «PLEASE«;\INPUT ZS\IF Z$*«YES" THEN 118 ELSE 2007 

2007 PRINT "SSSSSSSSSS.»\60T0 20*6 

2««CL0,tU, 20g 



BOOST ip YOU'RE HEADED RIghT"\gOTO 1950 



SAMPLE RUN 

WELCOME TO 'SPLAT' — THE GAME THAT SIMULATES A PARACHUTE 
JUMP. TRY TO OPEN YOUR CHUTE AT THE LAST POSSIBLE 
MOMENT WITHOUT GOING SPLAT. 



SELECT YOUR OWN TERMINAL VELOCITY (YES OR NO)? NO 
OK. TERMINAL VELOCITY * 796 MI/HR 

WANT TO SELECT ACCELERATION DUE TO GRAVITY (YES OR NO)? NO 
FINE. YOU'RE ON MERCURY. ACCELERATION- 12.2FT/SEC/SEC 

ALTITUDE ■ 9297 FT 

TERM. VELOCITY =1167.47 FT/SEC +-5% 

ACCELERATION = 12.2 FT/SEC/SEC +-5% 
SET THE TIMER FOR YOUR FREEFALL. 
HOW MANY SECONDS? 8 
HERE WE GO. 



TIME (SEC) 



DIST TO FALL (FT) 



9297 

1 9290.88 

2 9272.51 

3 9241.89 

4 9199.02 

5 9143.91 

6 9076.55 

7 8996.94 

8 8905.09 
CHUTE OPEN 

CONSERVATIVE AREN'T YOU? YOU RANKED ONLY 9 IN THE 

14 SUCCESSFUL JUMPS BEFORE YOURS. 
DO YOU WANT TO PLAY AGAIN? YES 



SELECT YOUR OWN TERMINAL VELOCITY (YES OR NO)? NO 
OK. TERMINAL VELOCITY = 971 MI/HR 

WANT TO SELECT ACCELERATION DUE TO GRAVITY CYES OR NO)? NO 
FINE. YOU'RE ON MERCURY. ACCELERATION* 12. 2FT/SEC/SEC 

ALTITUDE ■ 5884 FT 

TERM. VELOCITY ■ 1424.13 FT/SEC +-5% 

ACCELERATION « 12.2 FT/SEC/SEC +-S% 
SET THE TIMER FOR YOUR FREEFALL. 
HOW MANY SECONDS? 80 
HERE WE GO. 



TIME (SEC) 



10 
20 
30 
31.6066 



DIST TO FALL (FT) 

5884 

5295 

3527.99 

582.97 
SPLAT 
PUSHING UP DAISIES. 
I'LL GIVE YOU ANOTHER CHANCE. 
DO YOU WANT TO PLAY AGAIN? YES 



SELECT YOUR OWN TERMINAL VELOCITY (YES OR NO)? NO 
OK. TERMINAL VELOCITY * 740 MI/HR 

WANT TO SELECT ACCELERATION DUE TO GRAVITY (YES OR NO)? NO 
THEN YOU'RE ON NEPTUNE. ACCELERATI0N=39. 6FT/SEC/SEC 

ALTITUDE * 5189 FT 

TERM. VELOCITY = 1085.33 FT/SEC +-5% 

ACCELERATION ■ 39.6 FT/SEC/SEC +-5% 
SET THE TIMER FOR YOUR FREEFALL. 
HOW MANY SECONDS? 18 
HERE WE GO. 



TIME (SEC) 


DIST TO FALL (FT) 


33333933 S3 33 S3 33 S3 


= = = =: = = = = = = = =:=: = = = =: 





5189 


2.25 


5089.74 


4.5 


4791.95 


6.75 


4295.63 


9 


3600.78 


11.25 


2707.4 


13.5 


1615.5 


15.75 


325.072 


16.2678 


SPLAT 


MAY THE ANGEL 


OF HEAVEN LEAD YOU INTO PARADISE 


I 'LL GIVE YOU 


ANOTHER CHANCE. 


DO YOU WANT TO PLAY AGAIN? YES 



9999 END 



STARS 



A NUMBER GUESSING GAME 



Description 



In this game, the computer selects a random number from 1 to 100 
(or any value you set in Statement 150). You try to guess the 
number and the computer gives you clues to tell you how close 
you're getting. One star (*) means you're far away from the 
number; seven stars (*******) means you're really close. You 
get 7 guesses. 

On the surface this game is very similar to GUESS; however , the 
guessing strategy is quite different. See if you can come up 
with one or more approaches to finding the mystery number. 

Program Author 

Bob Albrecht 

People's Computer Company 

Men lo Park, CA 94025 




207 



PROGRAM LISTING 



100 REM *** STARS • PEOPLE'S COMPUTER CENTER, MENLO PARK, CA 

110 PRINT "STARS - A NUMBER GUESSING GAME" 

120 PRINT 

130 RANDOMIZE 

140 REM *** A IS LIMIT ON NUMBER, M IS NUMBER OF GUESSES 

150 LET AM00 

160 LET M«7 

170 PRINT "DO YOU WANT INSTRUCTIONS C1"YES 0*NO) H J 

180 INPUT Z 

190 IP Z«0 THEN 280 

200 REM •*•* INSTRUCTIONS ON HOW TO PLAY 

210 PRINT MI AM THINKING OF A WHOLE NUMBER FROM 1 TO«|A 

220 PRINT "TRY TO GUESS MY NUMBER. AFTER YOU GUE-SS, I" 

230 PRINT "WILL TYPE ONE OR MORE STARS (*), THE MORE" 

240 PRINT "STARS I TYPE, THE CLOSER YOU ARE TO MY NUMBER," 

250 PRINT "ONE STAR (*) MEANS FAR AWAY, SEVEN STARS (*******)" 

260 PRINT "MEANS REALLY CLOSEJ YOU GET" >MI "GUESSES. » 

270 REM *** COMPUTER 'THINKS 1 OF A NUMBER 

280 PRINT 

290 PRINT 

300 LET X«INT(A*RND(0)J+1 

3t0 print "ok, i am thinking of a number, start guessing." 

320 REM *** GUESSING BEGINS, HUMAN GETS M GUESSES 

330 FOR KM TO M 

340 PRINT 

350 PRINT "YOUR GUESS"! 

360 INPUT G 

370 IF GaX THEN 600 

380 LET DMBS(X-G) 



390 


IF D >■ 64 


THEN 


510 








400 


IF D >« 32 


THEN 


500 








410 


IF D >■ 16 


THEN 


490 








420 


IF D >■ 8 


THEN 


480 








430 


IF D >■ 4 


THEN 


470 








440 


IF >i 2 


THEN 


460 








450 


PRINT »*"| 












460 


PRINT »*"J 












470 


PRINT »*»; 












480 


PRINT «*"J 












490 


PRINT »*"| 












500 


PRINT "*«| 












510 


PRINT »*») 












520 


PRINT 












530 


NEXT K 












540 


REM *** DID NOT 


GUESS 


NUMBER 


IN M G 


550 


PRINT 












560 


PRINT "SORRY, THAT'S" 


|Mf« 


GUESSES, N 


580 


GOTO 280 












590 


REM *** WE 


HAVE 


A WINNER 






600 


FOR N»l TO 


50 










610 


PRINT "*"J 












620 


NEXT N 












630 


PRINT "til 


i 










640 


PRINT "YOU 


GOT 


IT IN 


"IKI 


"GUESSESIJ 


650 


GOTO 280 












660 


END 













NUMBER WAS«lX 



LET'S PLAY AGAIN.. 



OK, I AM THINKING OF ft NUMBER. START GUESSING. 
VOUR GUESS? 89 

*** 

VOUR GUESS? 56 
VOUR GUESS? 58 

** ************************************************ I » • 

VOU GOT IT IN 3 GUESSES!! LET'S PLAV ftGRIN. . . 



OK, I AM THINKING OF ft NUMBER. START GUESSING. 
VOUR GUESS? 26 



VOUR GUESS? 68 
**** 



VOUR GUESS? 8G 



VOUR GUESS? 82 
***** 



VOUR GUESS? 78 



VOUR GUESS? 77 

************************************************** i 
VOU GOT IT IN 6 GUESSES!! LET'S PLflV AGAIN... 



OK, I AM THINKING OF A NUMBER. START GUESSING. 
VOUR GUESS? 20 



VOUR GUESS? 44 
***** 



VOUR GUESS? 58 
**** 



VOUR GUESS? 38 
****** 



VOUR GUESS? 40 

************************************************** i i 
VOU GOT IT IN 5 GUESSES!! LET' S PLflV AGAIN... 



OK, I AM' THINKING OF A NUMBER. START GUESSING. 
VOUR GUESS? 80 



SAMPLE RUN 

STARS - A NUMBER GUESSING GAME 



VOUR GUESS? 32 
**** 



VOUR GUESS? 20 



DO VOU WANT INSTRUCTIONS <1=YES 0=NO>? 1 

.1 AM THINKING OF A WHOLE NUMBE FROM 1 TO 100 

TRV TO GUESS MV NUMBER. AFTER VOU GUESS, I 

WILLTVPE ONE OR MORE STARS <*). THE MORE 

STARS I TYPE, THE CLOSER VOU ARE TO MV NUMBER. 

ONE STAR <*) MEANS FAR AWAV. SEVEN STARS <*******> 

MEANS REALLV CLOSE! VOU GET 7 GUESSES. 



VOUR GUESS? 42 
***** 

VOUR GUESS? 46 

****** ******************************************** I 

VOU GOT IT IN 5 GUESSES!! LET'S PLAY AGAIN... 



OK, I AM THINKING OF A NUMBER. START GUESSING. 



VOUR GUESS? 50 



OK, I AM THINKING OF A NUMBER. START GUESSING. 



VOUR GUESS? 30 
**** 



VOUR GUESS? 75 
***** 



VOUR GUESS? 44 



VOUR GUESS? 82 



VOUR GUESS? 18 
****** 



VOUR GUESS? 67 
****** 



VOUR GUESS? 16 
***** 



VOUR GUESS? 68 
******* 



VOUR GUESS? 20 
******* 



VOUR GUESS? 69 

************************************************** I 

VOU GOT IT IN 6 GUESSES!! LET'S F'LAV AGAIN... 



VOUR GUESS? 21 

************************************************** I 

VOU GOT IT IN 6 GUESSES!! LET'S. PLflV AGAIN... 



208 



STOCK 



PLAY THE STOCK MARKET 



Description 



This program "plays" the stock market. You will be given $10,000 
and may buy or sell stocks. Stock prices and trends are generated 
randomly; therefore, this model does not represent exactly what 
happens on the exchange. (Depending upon your point of view, you 
may feel this is quite a good representation!) 

Every trading day, a table of stocks, their prices, and number of 
shares in your portfolio is printed. Following this, the initials 
of each stock are printed followed by a question mark. You in- 
dicate your transaction in number of shares — a positive number 
to buy, negative number to sell, or to do no trading. A 
brokerage fee of 1% is charged on all transactions (a bargain!). 
Note: Even if the value of a stock drops to zero, it may re- 
bound again — then again, it may not. 

Source 

A good stock market game for EduSystem 30 was submitted by John 
Tieman of Adlai Stevenson High School, Prairie View, Illinois; 
it was written by a student named Gidzinski. Another one was 
written by G. Clayton Jobel of Concord, NH, for EduSystem 10! 
The authors of the one printed are: 

D. Pessel, L. Braun, C. Losik 

Huntington Computer Project 

SUNY 

Stony Brook, NY 




© 1962 by E.C. Publications 



209 



PROGRAM LISTING 



100 REM STOCK MARKET SIMULATION •STOCK* 
_1JI REM REVISED 8/18/70 CO. PESSEL, I, BRAUN, C, LOSIK) 

102 REM IMP VRBLSJ A-MRKT TRND 8LP; B5-BRKRGE FEE; C-TTL CSH A8ST8I 

103 REM C5-TTL CSH A 8STS (TEMP) ; C C H-C H N G I N_S T K___VAL ;_ D-TTL A83 TS I 

104 REM E1,E2-LRG CHNG MlSCl I*STCK #| I1,I2-3TCK3 W LRG CHNG; 

JL05 REM N1,N2-LRG CHNG DAY CNTS; P5-TTL DAYS PRCHSS; P(I)-PRTFL CNTNTSl 

106 REM Q9-NEW CYCL7I S4-SGN OF A? S5-TTL DY8 SLS; S (I ) -VALUE/SHR; 

107 REM T-TTl STCK AS8TSI T6-TTL VAL OF TRNSCTN3; 

108 REM W3-LRG CHNG; Xl-SMLL CHNG(<$1); Z4 , Z5, Z6-NYSE AVE.; Z(I)-TRN3CTN, 

109 PRIN T TAB ( 20) ;"THE STO C K_ M ARK E T « 

110 DIM S(5),"P(53~,Z(5f,C(5) 

J12 REM SLOPE OF MARKET TRENDlA (SAME FOR ALL STOCKS) 

113 RANDOMIZE 
J14 LET ApINT((RND(X)/10)*100+, 53/100 

115 LET T5«0 

Ufl LET X9«0 
Tt7 LET~N1p0 

1 1,8 LET N2»0 

119" LET E1*0 
J20 LET E2»0 

121 REM INTRODUCTION 

122 PRIN T "DO YOU WANT THE INSTRUCTIONS (YES- TYPE 1, NO? TYPE 0)_M 

123 INPUT Z9 
PRINT 
PRINT 

IF Z9<1 THEN 200 

PRINT "THIS PROGRAM PLAYS THE STOCK MARKET. YOU WILL BE GIVEN" 
PRINT "$10,000 AND MAY BUY OR SELL STOCKS, THE STOCK PRICES WILL" 
PRINT "BE GENERATED RANDOMLY AND THEREFORE "THIS" MODEL DOES NOT" 
PRINT "REPRESENT EXACTLY WHAT HAPPENS ON THE EXCHANGE. A TABLE" 



Jl24 
125" 
126 
130 
132 

T34~ 
135 

136 
137 
138 
139 



PRINT "OF AVAILABLE STOCKS, THEIR PRICES, AND THE NUMBER OF SHARES" 
PRINT "IN YOUR PORTFOLIO WILL BE PRINTED, FOLLOWING THIS, THE" 
PRINT "INITIALS OF EACH STOCK WILL BE PRINTED WITH A QUESTION" 
PRINT "MARK, HERE YOU INDICATE A TRANSACTION, TO BUY A STOCK" 

140 PlH"Nr""Ty"Pr" + NNN, TO SELL "A" STOCK TYPE -NNN, WHERE" NNN IS THE" 

141 PRINT "NUMBER OF SHARES, A BROKERAGE FEE OF IX WILL BE CHARGED" 

142 PRINT "ON ALL TRANSACTIONS, NOTE THAT IF A STOCK'S VALUE DROPS" 

143 PRINT "TO ZERO IT MAY REBOUND TO A POSITIVE VALUE AGAIN, YOU" 

144 PRINT "HAVE $10,000 TO INVEST, USE INTEGERS FOR ALL YOUR INPUTS," 
145 PRINT "(NOTEl TO GET A 'FEEL' FOR THE MARKET RUN FOR AT LEAST" 

~T4~5 FRTNT "T0 DAYSy» 

147 PRINT " — ---GOOD LUCKJ » 

200 REM GENERATION OF STOCK TABLE; INPUT REQUESTS 

210 REM INITIAL STOCK VALUES 

220 LET 8(13*100 

2 30 LET S(2)«86 
H240 "LET S(3)"150 

250 LET 8(4)1140 

260 LET S(5)*110 

265 REM INITIAL T8 - # DAYS FOR FIRST TREND SLOPE (A) 

266 LET T8»lNT(4.99*RND(X)+i) 

267 JREM RANDOMIZE SIGN OF FIRST TREND SLOPE (A) 
"2W IT RnD(X)>,5ThEN 270 

269 LET Ap.A 

270 REM RANDOMIZE INITIAL VALUES 
280 GOSUB 830 

285 REM INITIAL PORTFOLIO CONTENTS 

2 90 FOR I«l TO 5 
"T00 LET P(I)«0 

305 LET Z(I)"0 

310 NEXT I 

320 PRINT 

330 PRINT 

333 REM INITIALIZE CASH ASSETSiC 

335 LET CP10000 

338 REM PRINT INITIAL PORTFOLIO 

340 PRINT "STOCK"," "," INITIALS" , "PRICE/SHARE" 

350 PRINT "INT, BALLISTIC MISSILES"," IBM",S(1) 

352 PRINT "RED CROSS OF AMERICA", « RCA",S(23 

354 PRIjnj'LICHTENSTEIN, BUMRAP & JOKE"," LBJ",S(3) 
~3B~6 """PRINT "AMERICAN "BANKRUPT CO,"," A8C",S(4) 

358 PRINT "CENSURED BOOKS STORE"," CBS", 8(5) 

360 PRINT 

361 REM NYSE AVERAGEIZ5; TEMP, VALUEIZ4; NET CHANQEIZ6 

363 LET Z4«Z5 

364 LET Z5«0 



"365 LET T'«0 

370 FOR I«t TO 5 

375 LET Z5pZ5+S(I) 

380 LET T"T+S(I)#P(I) 

390 NEXT I 

391__LET ZS»I_NT(100*(Z5/5)*. 53/100 

"392 "LET"Z6»INT((Z5^Z^y*100+,5)/100 

393 REM TOTAL ASSETSfD 

394 LET D*T+C 

395 IF X9>0 THEN 398 

396 PRINT "NEW YORK STOCK EXCHANGE AVERAGE! 

397 GO TO 399 
"198~ 



PRINT " NEW" yORK "STOCK EXCHANGE 

399 PRINT 

400 LET T«INT(100*T+, 5)/100 

401 PRINT "TOTAL STOCK ASSETS ARE 
403 LET C«INT(100*C+, 53/100 
405 PRINT "TOTAL CASH ASSETS ARE 

407 LET D p I N T ( 1 * D + , 5 ) 7T00 

408 PRINT "TOTAL ASSETS ARE 
"410 PRINT 

Jll IF X9«0 THEN 416 

412 PRINT "DO YOU WISH TO CONTINUE (YES-TYPE 1, NO-TYPE 03"; 

413 INPUT 09 



AVERAGEl »Z5«" NET CHANGE; «Z6 



I " I C 



$"1D 



414 IF Q9<f THEN 998 ~ 

416 REM INPUT TRANSACTIONS 

420" PRINT "WHAT IS YOUR TRANSACTION IN" 

430 PRINT "IBM"; 

440 INPUT ZCi) 

450 _PRINT J'RCA"; 



IN $|P5 



460 


INPUT Z(2 3 


470 


PRINT "LBJ"; 


480 


INPUT Z(3) 


490 


PRINT "ABC"; 


500 


INPUT Z(4) 


510 


PRINT »cbs«; 


520 


INPUT Z(5) 


525 


PRINT 


530 


REM TOTAL DAY'S PURCHASES 


540 


LET P5P0 



150 "REM TOTAL DAY'S SALES IN $|S5 
560 LET SSpQ 

FOR I"l "TO 5 

LET Z(1)"INT(ZCI)*.S) 

IF Z(I)<«0 THEN 610 

LET P6»P5*Z(I)*8(I) 

GO TO 620 

LET S5PS 5j- Z_(_IJ »S(I) _ 

TF~^Z(I)«pP(I) THEN 620 



"57T 
575 

W0 

590 

600 

610 
*12~ 

614 PRINT "YOU HAVE OVERSOLD A STOCK; TRY AGAIN," 
"616" GO TO 420 

620 NEXT I 
"622 REM TOTAL VALUE OF TRANSACTI0NS|T5 

625 LET T5iP5*85 

630 REM BROKERAGE FEE;B5 

640 LET B5«INT(.01*T5*100+ # 5)/l00 

650 REM CASH ASSETSpOLD CASH ASSETS-TOTAL PURCHASES 

652 REM -BROKERAGE FEES+TOTAL SALES1C5 

654 LET C5iC-P5-B5+85 

656 IF C5»»0 T H EN 674 

658 PRINT" "YOU HAVE USED $";-C5"M0RE THAN >0U HAVE. "" 

660 GO TO 420 

674 LET C«C5 

675 REM CALCULATE NEW PORTFOLIO 
680 FOR HI TO 5 

690 L ET P ( I ) pP ( n_*J (I? 

T00 NEXT T" 

710 REM CALCULATE NEW STOCK VALUES 
720 GOSUB 830 
750 REM PRINT PORTFOLIO 

76Y "REM BELL RiNGlNG-DIFFERENt ON MANY COMPUTERS 
752 FOR Iil TO 20 
T5T PRTINT CW$~(TJ5Tr 
. 754 NEXT I 
PRINT 

PRINT "***#****#* END OF DAY'S TRADING" 
PRINT 

PRIjn 

VT X9«i" THEN 769 

PRINT "STOCK", "PRICE/SHARE", "HOLDINGS", "VALUE", "NET PRICE CHANGE" 
PRINT "IBM", 8(1), P(l), S(t)*P(l), C(l) 
S(23*P(2), C(2) 
S(3)*P(3), C(3) 
P Ji5,_S(4)*P(4), 
ST5"3"*P(5), 



755 
756 
757 
758 
TBI 
769 
770 

771 
772 
773 
774 
775 
780 
_790 
810" 



PRINT "RCA", S(2), 
PRINT "LBJ", S(3), 
PRINT "ABC", S(4), 



P(2), 
P(3), 



"S15T, "T(5j", 



C(4) 
C(5 3 



210 



PRXNT "CBS 

LET X9«l 

PRINT 

PRINT 

GO TO 360 

829 REM NEW^ STOCK VALUES^ • SUBROUTINE __. 

^30 PTEM" "RANDOMLY "PRODUCE NTW STOCK VALUES BASED ON PREVIOUS 

831 REM DAY'S VALUES 

832 REM Ni,N2 ARE RANDOM NUMBERS OF DAYS WHICH RESPECTIVELY 

833 REM DETERMINE WHEN STOCK II WILL INCREASE 10 PTS, AND STOCK 

834 REM 12 WILL DECREASE 10 PTS. 

840 REM IF Nl DAYS HAVE PASSED, PICK AN II. SET El, DETERMINE NEW Ni 
"84! IF N"1>0" THEN 8S0 

845 LET I1«INT(4,99*RND(X)+1) 

846 LET N1«INT(4,99*RN0(X)*1) 

847 LET El«l 

850 REM IF N2 DAYS HAVE PASSED, PICK AN 12, SET E2, DETERMINE NEW N2 
^51 IF N2>0 THEN 860 

855 LET I2VlNT(4,99*RND(X)+i) 

856 LET N2«INT(4.99*RND(X)«-1) 

857 LET E2M 

860 REM DEDUCT ONE DAY FROM Nl AND N2 

861 LET N1*N1-1 

862 LET N2pN2»_1 

Wi REM "LOOP THROUGH ALL" STOCKS 
900 FOR 1*1 TO 5 
910 LET X1"RND(X) 

915 IF Xl>,25 THEN 920 

916 LET XIp.25 
9JJ GO TO 935 

•920 IF Xl>,50 THEN 925 

921 LET XI*. 50 

922 GO TO 935 

925 IF Xl>,75 THEN 930 

926 LET Xi»,75 

927 GO TO 935 

930 LET X1*0,0 

931 REM BIG CHANGE C0NSTANTJW3 (SET TO ZERO INITIALLY) 

935 LET W3«0 

936 IF EK1 THEN 945 

937 IF INT(I1+.5)<>INT(I+,S) THEN 945 
?_38__ R J M _ADDJ0__PT_S^ TO THIS STOCK; RESET El 
939 LET W3«i0- ' " 

943 LET E1P0 

945 IF E2<1 THEN 955 

947 IF INT(I2+,5)<>INT(I*,53 THEN 955 

948 REM SUBTRACT 10 PTS, FROM THIS STOCK; RESET E2 

949 LET W;3PW3-10 
953 "LET E2p0 

984 REM C( I) IS CHANGE IN STOCK VALUE 

955 LET C(I)»INT(A*S(I))+X14.INT(3-6*RND(X)*,5) + W3 

LET C(I)»INT(100*C (I)*, 53/100 

LET S(I)PS(I3*C(I) 

IF 3(I) »0 THEN 9fi^ 

LET C(I)p0" 

LET 8(1) *0 

GO TO 970 

LET S(I)PINT(100*S(I)*,5)/100 

NEXT I 

97 2 REM AFTER T6 DAYS RAN DOMLY CHANGE TREND SIGN AND SLOPE 

973 LET T8PT8-1 

974 IF T8<1 THEN 985 
980 RETURN 

985 REM RANDOMLY CHANGE TREND 3IGN AND SLOPE (A), AND DURATION 

986 REM OF TREND (T'8) 
990 LET T8PINT(4.99»RND (X)*1) 

LET AilNT((RND(X)/10)*i00* i 5)/100 

LET 84«RND(X) 

IF S4«p,5 THEN 997 

LET Ap-A 

RETURN 

PRINT "HOPE YOU HAD FUN! J" 



J56 

957 

960 

M4~ 

965 

966 

967 

970 



992 
993 
994 
995 
997 
998 
9~99 



SAMPLE RUN 

THE STOCK MARKET 
DO YOU WANT THE INSTRUCTIONS (YES-TYPE 1, NO-TYPE 0>? 



THIS PROGRAM PLAYS THE STOCK MARKET. YOU WILL BE GIVEN 
*19, 090 AND MAY BUY OR SELL STOCKS. THE STOCK PRICES WILL 
BE GENERATED RANDOMLY AND THEREFORE THIS MODEL DOES NOT 
REPRESENT EXACTLY WHAT HAPPENS ON THE EXCHANGE. A TABLE 
OF AVAILABLE STOCKS, THEIR PRICES, AND THE NUMBER OF SHARES 
IN YOUR PORTFOLIO WILL BE PRINTED. FOLLOWING THIS, THE 
INITIALS OF EACH STOCK WILL BE PRINTED WITH A QUESTION 
MARK. HERE YOU INDICATE A TRANSACTION. TO BUY A STOCK 
TYPE +NNN, TO SELL A STOCK TYPE -NNN, WHERE NNN IS THE 
NUMBER OF SHARES. A BROKERAGE FEE OF ±7. WILL BE CHARGED 
ON ALL TRANSACTIONS. NOTE THAT IF A STOCK'S VALUE DROPS 
TO ZERO IT MAY REBOUND TO A POSITIVE VALUE AGAIN. YOU 
HAVE *10, @00 TO INVEST. USE INTEGERS FOR ALL YOUR INPUTS. 
<NOTE: TO GET A '-.FEEL'' FOR THE MARKET RUN FOR AT LEAST 

19 days:? 

GOOD LUCK! 



STOCK INITIALS 
INT. BALLISTIC MISSILES IBM 
RED CROSS OF AMERICA RCA 

LICHTENSTEIN, BUMRAP 6 JOKE LBJ 
AMERICAN BANKRUPT CO. ABC 

CENSURED BOOKS STORE CBS 

NEW YORK STOCK EXCHANGE AVERAGE: 115 



TOTAL STOCK ASSETS ARE 
TOTAL CASH ASSETS ARE 
TOTAL ASSETS ARE 



* 

$ 10000 
$ 10000 



WHAT IS YOUR TRANSACTION IN 

IBM? 20 

RCA? 5 

LBJ? 

ABC? 5 

CBS? 10 



END OF DAY'S TRADING- 



PR ICE/SHARE 
107. 25 
85. 75 
147. 5 
127. 75 
99. 25 



********** 


END OF DAY'S 


TRADING- 


STOCK 


PRICE/SHARE 


HOLDING: 


IBM 


87. 25 


20 


RCA 


74. 5 


15 


LBJ 


126. 5 





ABC 


111 


5 


CBS 


82. 25 


20 



NEW YORK STOCK EXCHANGE AVERAGE: 



VALUE 
2617. 5 
1117. 5 



555 
1645 



NET CHANGE: 



NET PRICE CHANGE 

-5 

-1. 25 

-2 

-4. 25 

-2. 5 



TOTAL STOCK ASSETS ARE 
TOTAL CASH ASSETS ARE 
TOTAL ASSETS ARE 



* 5925 

* 2808. 8 

* 8742. 8 



DO YOU WISH TO CONTINUE (YES-TYPE 1, NO-TYPE 0>? 1 

WHAT IS YOUR TRANSACTION IN 

IBM? 

RCA? 

LBJ? 

ABC? 

CBS? 



VALUE 
2692. 5 
1208. 75 


570 
1665 



********** 


END OF DAY' 


S 


TRADING- 


STOCK 


PRICE/SHARE 


HOLDING: 


IBM 


89. 75 




20 


RCA 


87. 25 




15 


LBJ 


125. 75 







ABC- 


114 




5 


CBS 


82. 25 




20 



NET PRICE CHANGE 

2. 5 

12. 75 
-. 75 



NEW YORK STOCK EXCHANGE AVERAGE: 100 

TOTAL STOCK ASSETS ARE * 6226. 25 
TOTAL CASH ASSETS ARE * 2808.8 
TOTAL ASSETS ARE * 9045. 05 



NET CHANGE: 



STOCK 

IBM 

RCA 

LBJ 

ABC 

CBS 



PRICE/SHARE 
107. 75 
82 
145 

122. 75 
95. 75 



HOLDINGS 



HEW YORK STOCK EXCHANGE AVERAGE: 112.85 

TOTAL STOCK ASSETS ARE * 4191. 25 
TOTAL CASH ASSETS ARE $ 5702. 45 
TOTAL ASSETS ARE * 9892.7 



VALUE 
2155 
415 



662. 75 
957. 5 


NET PRICE CHANGE 

. 5 
-2. 75 
-2. 5 
-5 
-2. 5 


NET CHANGE: 


-2. 65 



DO YOU WISH TO CONTINUE < YES-TYPE 1, NO-TYPE 0>? 

WHAT IS YOUR TRANSACTION IN 

IBM? 5 

RCA? 10 

LBJ? 5 

ABC? O 

CBS? 10 

YOU HAVE USED * 1.52995 MORE THAN YOU HAVE. 

WHAT IS YOUR TRANSACTION IN 

IBM? 5 

RCA? 10 

LBJ? 5 

ABC? 

CBS? 9 



DO YOU WISH TO CONTINUE < YES-TYPE 1, 

WHAT IS YOUR TRANSACTION IN 

IBM? 10 

RCA? 10 

LBJ? O 

ABC? 

CBS? 10 



END OF DAY'S TRADING- 



NO- TYPE ©>? 



STOCK 
IBM 
RCA 
LBJ 
ABC- 
CBS 



NEW YORK STOCK EXCHANGE AVERAGE: 106.4 



'RICE/SHARE 


HOLDINGS 


99. 75 


20 


78. 75 


15 


140. 5 





122. 75 


5 


90. 25 


20 



VALUE 


NET 1 


2992. 5 


-8 


1181. 25 


-4. 2! 





-4. 5 


612. 75 


-10 


1805 


-5. 5 


NET CHANGE: 


-6. 45 



NET PRICE CHANGE 



TOTAL STOCK ASSETS ARE 
TOTAL CASH ASSETS ARE 
TOTAL ASSETS ARE 



6592. 5 
2808. 8 
9401. 2 



********** 


END OF DAY- 


S TRADING 






STOCK 


PR I CE/SHARE HOLDINGS 


VALUE 


NET 1 


IBM 


92. 75 


25 


2281. 25 


4 


RCA 


95 


25 


2275 


7. 7! 


LBJ 


120. 75 


5 


652. 75 


5 


ABC- 


122. 75 


5 


612. 75 


8, 7! 


CBS 


85. 75 


29 


2486. 75 


2. 5 


NEW YORK STOCK EXCHANGE 


AVERAGE : 105. 6 


NET CHANGE: 


5. 6 


TOTAL STOCK 


: ASSETS ARE 


* 9410. 5 






TOTAL CASH 


ASSETS ARE 


% 82. 56 






TOTAL ASSETS ARE 


* 9492. 06 







NET PRICE CHANGE 



DO YOU WISH TO CONTINUE < YES-TYPE 1, NO-TYPE O)? 1 

WHAT IS YOUR TRANSACTION IN 

IBM? O 

RCA? O 

LBJ? O 

ABC? 

CBS? 



DO YOU WISH TO CONTINUE (YES-TYPE 

WHAT IS YOUR TRANSACTION IN 

IBM? O 

RCA? O 

LBJ? O 

ABC? © 

CBS? O 



******* END OF DAY'S TRADING 



NO-TYPE 0>? 1 



END OF DAY'S TRADING 



STOCK 
IBM 
RCA 
LBJ 
ABC- 
CBS 



PR I CE/SHARE 
98 

106. 5 
129. 5 
129. 75 
89. 5 



HOLDINGS 
25 

25 



VALUE 
2420 
2512. 5 
697. 5 
652. 75 
2595. 5 



NET PRICE CHANGE 

4. 25 

5. 5 
8. 75 

2. 75 



STOCK 

IBM 

RCA 

LBJ 

ABC 

CBS 



PR I CE/SHARE 


HOLDINGS 


92. 25 


20 


75. 75 


15 


129. 5 





115. 25 


5 


84. 75 


20 



VALUE 
2767. 5 
1126. 25 



576. 25 
1695 



NET PRICE CHANGE 



-11 
-7. 5 
-5. 5 



NEW YORK STOCK EXCHANGE AVERAGE: 1 

TOTAL STOCK ASSETS ARE * 9889. 25 
TOTAL CASH ASSETS ARE $ 82. 56 
TOTAL ASSETS ARE $ 9971. 81 



NET CHANGE: 



DO YOU WISH TO CONTINUE (YES-TYPE 1, NO-TYPE 0>? 



NEW YORK STOCK EXCHANGE AVERAGE: 



NET CHANGE : -6. 9 



TOTAL STOCK ASSETS ARE * 6175 
TOTAL CASH ASSETS ARE * 2808. 8 
TOTAL ASSETS ARE * 8982. 8 



DO YOU WISH TO CONTINUE ( YES-TYPE 1, 

WHAT IS YOUR TRANSACTION IN 

IBM? O 

RCA? 

LBJ? 

ABC? 

CBS? O 



NO- TYPE 0)? 



211 



SYNONM 



WORD SYNONYMS 



Description 

A synonym of a word is another word in the English language 
which has the same, or very nearly the same, meaning. This 
program tests your knowledge of synonyms of a few common words. 

The computer chooses a word and asks you for a synonym. The 
computer then tells you whether you're right or wrong. If you 
can't think of a synonym, type "HELP" which causes a synonym 
to be printed. 

You may put in words of your choice in the data statements (510-600) 
The number following DATA in Statement 500 is the total number 
of data statements. In each data statement, the first number 
is the number of words in that statement. 

Can you think of a way to make this into a more general kind of 
CAI program for any subject? 

Program Author 

Walt Koetke 
Lexington High School 
Lexington, MA 02173 




"\ *> '*'' ° J li' '• 

¥*■;<>!■:■■ - 



Cii^S 



?;^-;AV-'. 



212 






1967 by Meredith Press 



PROGRAM LISTING 



SAMPLE RUN 



LIST 

SVNONM 83:17 PM 89-JUL-73 

5 REM *** SVNONM CONVERTED TO RSTS/E BASIC-PLUS BV DAVE AHL, DIGITAL 

10 DIM R*<5>,W*<18>, L<30>,R<30> 

28 R*<1> = "RIQHT":R*(:2> = "C0RRECT":R*C3> = "FINE":R*<:4> = "G00D!":R*C'5:' = "CHECK" 

70 RANDOMIZE:C=0:PRINT:PRINT " SVNON VMS ": PRINT 

90 PRINT "A SVNONVM OF R WORD MEANS ANOTHER WORD IN THE ENGLISH" 

100 PRINT "LANGUAGE WHICH HRS THE SRME OR VERV NEARLV THE SAME" 

110 PRINT "MEANING. ":PRINT 

130 PRINT "I CHOOSE A WORD — VOU TVPE A SVNONVM. " 

140 PRINT "IF VOU CAN'T THINK OF A SVNONVM, TVPE THE WORD 'HELP'" 

145 PRINT "AND I WILL TELL VOU A SVNONVM. ": PRINT 

158 RESTORE : C=C+1 : READ N 

160 IF ON THEN 420 

170 N1=INT<RND*N+1> 

174 IF R<N1>=1 THEN 170 

176 R<N1>=1 

ISO FOR 1=1 TO Nl 

190 READ N2 

200 FOR J=l TO N2 

210 READ M*<J> 

220 NEXT J 

230 NEXT I 

232 L<J)=J FOR J=l TO N2 

235 L<0>=N2:G=1: PRINT 

237 L<G>=L<L<0>>:L<0>»N2-1:PRINT 

240 PRINT " WHAT IS A SVNONVM OF "W*CG>; : INPUT A$ 

250 IF A*="HELP" THEN 340 

260 FOR J=l TO N2 

270 IF G=J THEN 290 

280 IF A*=W*<J> THEN 320 

290 NEXT J 

300 PRINT " TRV AGAIN. " 

310 GOTO 248 

320 PRINT R*<RND*5+1> 

330 GOTO 150 

340 G1=INT<RND*L<::0>+1> 

360 PRINT "**** A SVNONVM OF "W*<Q>" IS "W*<:L<:G1> > ". " 

365 PRINT 

370 L < Gl > =L < L < > > : L < > =L < > -1 

390 GOTO 240 

420 PRINT .PRINT "SVNONVM DRILL COMPLETED. " : STOP 

500 DATA 10 

510 DATA 5, "FIRST", "START", "BEGINNING", "ONSET", "INITIAL" 

520 DATA 5, "SIMILAR", "ALIKE", "SAME", "LIKE", "RESEMBLING" 

530 DATA 5, "MODEL", "PATTERN", "PROTOTVPE", "STANDARD", "CRITERION" 

540 DATA 5, "SMALL", "INSIGNIFICANT", "LITTLE", "TINV", "MINUTE" 

550 DATA 6, "STOP", "HALT", "STAV", "ARREST", "CHECK", "STANDSTILL" 

560 DATA 6, "HOUSE", "DWELLING", "RESIDENCE", "DOMICILE", "LODGING", "HABITATION" 

570 DATA 7, "PIT", "HOLE", "HOLLOW", "WELL", "GULF", "CHASM", "ABVSS" 



RUN 

SVNONM 03:19 PM 



09-JUL-73 



580 DATA 7, "PUSH' 

590 DATA 6, "RED", 

600 DATA 7, "PAIN 1 
999 END 

READV 



, "SHOVE", "THRUST", "PROD", "POKE", "BUTT", "PRESS" 

"ROUGE", "SCARLET", "CRIMSON", "FLAME", "RUBV" 

, "SUFFERING", "HURT", "MISERV", "DISTRESS", "ACHE", "DISCOMFORT" 



A SVNONVM OF A WORD MEANS ANOTHER WORD IN THE ENGLISH 
LANGUAGE WHICH HAS THE SAME OR VERV NEARLV THE SAME 
MEANING. 

I CHOOSE A WORD — VOU TVPE A SVNONVM. 

IF VOU CAN'T THINK OF A SVNONVM, TVPE THE WORD 'HELP' 

AND I WILL TELL VOU A SVNONVM. 



WHAT IS A SVNONVM OF FIRST? START 
CORRECT 



WHAT IS A SVNONVM OF PIT? WELL 



WHAT IS A SVNONVM OF SMALL? TINV 



WHAT IS A SVNONVM OF HOUSE? HOME 

TRV AGAIN. 

WHAT IS A SVNONVM OF HOUSE? DWELLING 



WHAT IS A SVNONVM OF MODEL? SIMULATION 
TRV AGAIN. 

WHAT IS A SVNONVM OF MODEL? HELP 
***.* fl SVNONVM OF MODEL IS PROTOTVPE. 

WHAT IS A SVNONVM OF MODEL? STANDARD 



WHAT IS A SVNONVM OF RED? ROSE 
TRV AGAIN. 

WHAT IS A SVNONVM OF RED? HELP 
**** A SVNONVM OF RED IS FLAME. 

WHAT IS A SVNONVM OF RED? HELP 
**** A SVNONVM OF RED IS RUBV. 

WHAT IS A SVNONVM OF RED? CRIMSON 



WHAT IS A SVNONVM OF SIMILAR? SAME 
CORRECT 



WHAT IS A SVNONVM OF PUSH? SHOVE 



WHAT IS A SVNONVM OF STOP? END 

TRV AGAIN. 

WHAT IS A SVNONVM OF STOP? HALT 



WHAT IS A SVNONVM OF PAIN? DISTRESS 



CHECK 

SVNONVM DRILL COMPLETED. 



213 



TARGET 



DESTROY A TARGET IN 3-D SPACE 



Description 



In this program, you are firing a weapon from a spaceship in 
3-dimensional space. Your ship, the Starship Enterprise, is 
located at the origin (0,0,0) of a set of x,y,z coordinates. 
You will be told the approximate location of the target in 
3-dimensional rectangular coordinates, the approximate angular 
deviation from the x and z axes in both radius and degrees, 
and the approximate distance to the target. 

Given this information, you then proceed to shoot at the target, 
A shot within 20 kilometers of the target destroys it. After 
each shot, you are given information as to the position of the 
explosion of your shot and a somewhat improved estimate of the 
location of the target. Fortunately, this is just practice 
and the target doesn't shoot back. After you have attained 
proficiency, you ought to be able to destroy a target in 3 or 4 
shots. However, attaining proficiency might take a while! 

Program Author 

H. David Crockett 
5609 Wimbleton Way 
Fort Worth, TX 76133 















































\ 








J^ 








***' 


;,vf* 








\ - • " 


•"' ^ 








\ 




^'^ 










\ 


s^ r ' 




^^i 








#*"^" 










..-•"*,' 






~\. 






t ..> J *' 


















; 




[--■ V ^ 
















>-- 




f--- 














* +-'•'■''. ". 














,."■"■ 






















i 








^ - 


„' 














-r-^. -H 






















..' 






















''*' 1 








_^^H 












\ 


\j 














w 








? 











Illustration by John Nelson, 
Scott, Foresman and Co. 



214 



PROGRAM LISTING 



SAMPLE RUN 



100 R»1\R1»57,296\RAND0MI2E 

110 PRINT "YOU ARE THE WEAPONS OFFICER ON THE STAR SHIP ENTERPRISE" 
120 PRINT "AND THIS IS A TEST TO SEE HOW ACCURATE A SHOT YOU"' 
130 PRINT " ARE IN A THREE- DIMENSIONAL RANGE, YOU WRL_BE TOLD«_ 
140 PRINT~"THE RADIAN OFTSETTOPT THE X AND Z AXES, "THE LOCATION" 
150 PRINT "OF THE TARGET IN THREE-DIMENSIONAL RECTANGULAR COORDINATES," 
160 PRINT "THE APPROXIMATE NUMBER OF DEGREES FROM THE X AND Z» 
170 PRINT "AXES, AND THE APPROXIMATE DISTANCE TO THE TARGET," 
180 PRINT "YOU WILL THEN PROCEED TO SHOOT AT THE TARGET UNT'IL IT IS" 
190 PRINT "DESTROYED! nPRlNTSPRINT "GOOD LUCK U "\PRINT\PRINT 
"220 A ■ R1^^*PT\B1WND* 2 *PT\ Q ■ IN T ( A * R 1) \ W « I N T"( B * R i ) 
260 PRINT "RADIANS FROM X AXIS »«A" FROM Z ,AXIS »«B 
270 PRINT "APPROX DEGREES FROM X AXIS ■ »Q« FROM Z AXIS »»W 
280 P«100000*RND+RND\X«SIN(B)*COS(A)*P\Y»SIN(B)*SIN(A)*P\Z«COSCB^*P 
340 PRINT "TARGET SIGHTED! APPROX COORDINATES X*"X" Y» M Y" Z*"Z 
345 R*R*1\IF R>5 THEN 390 
3W~0~N "1R GOTO " 3"58"i"3W", 365 , 370 , 375 
355 P3«INT(P*.05)*20\GOTO 390 
T60 P3«»INT(P* i n*i0\GOTO 390 
365 P3«INT(P*,5)*2\G0T0 390 
370 P3»INTCP)\G0T0 390 

375 P3»P _ 

390 PRTNT « ESTIMATED DISTANCE- "P3~ 

400 INPUT "INPUT ANGLE DEVIATION FROM X, DEVIATION FROM Z, DISTANCE" M 1 , Bi , P2 
410 PRINTMF P2<20 THEN PRINT "YOU BLEW YOURSELF UPjl M \GOTO 580 
420 A1»A1/R1NB1«B1/R1\PRXNT "RADIANS FROM X AXIS «"A1" FROM Z AXIS ■"81 
480 Xl«P2*SIN(Bl)*C0SCAi)\Yl«P2*SlN(Bn*SIN(Al)SZl»P2*C0S(Bl) 
510 P» (<XW)A2*m»Y)A2»(Zl»Z)A2)A(l/2) 
520 IF" D>20 THEN "670 "" 

530 PRINTVPRINT «# * * HIT * * * TARGET IS NON-FUNCTIONAL"\PRlNT 
550 PRINT "DISTANCE OF EXPLOSION FROM TARGET WAS"D"KILOMETERS" 
570 PRINTVPRINT "MISSION ACCOMPLISHED IN"R"SHOTS,« 

580 R-0SFOR 1*1 TO 5\PRINT\NEXT I\PRINT "NEXT TARGET. ,., «\PRINT\GOTO 220 
670 X2*Xl.i»XSY2»Yl-Y\Z2«Zl-Z\IF X2<0 THEN 730 

TTeTPRTNT "SHOT IN FRONT OF TARGET«X2"KIL0METERS, "\GOTO 740 
730 PRINT "SHOT BEHIND TARGET" l-X2"KIL0METERS, " 
740 IF Y2<0 THEN 77% 

750 PRINT "SHOT TO LEFT OF TARGET" Y2"KIL0METERS, "SGOTO 780 
772 PRINT "SHOT TO RIGHT OF TARGET" I -Y2"KIL0METERS, « 
780 IF_Z2<0 THEN 810 

790 PRINT "SHOT ABOVE TARGET«Z2»KIL0METERS , "\GOTO 8220 
810 PRINT "SHOT BELOW TARGET'' ;-Z2»KIL0METERS , " 

820 PRINT "APPROX POSITION OF EXPLOSlONi X«"X1" Y»"Y1" Z*"Z1 
830 PRINT " DISTANCE FROM TARGET «"D\PRINT\PRINT\PRINT\GOTO 345 
999 END 



VOU ARE THE WEAPONS OFFICER ON THE STAR SHIP ENTERPRISE 

AND THIS IS A TEST TO SEE HOW ACCURATE A SHOT VOU 

ARE IN A THREE-DIMENSIONAL RANGE. VOU WILL BE TOLD 

THE RADIAN OFFSET FOR THE , X AND Z AXES, THE LOCATION 

OF THE TARGET IN THREE-DIMENSIONAL RECTANGULAR COORDINATES, 

THE APPROXIMATE NUMBER OF DEGREES FROM THE X AND 2 

AXES, AND THE APPROXIMATE DISTANCE TO THE TARGET. 

VOU WILL THEN PROCEED TO SHOOT AT THE TARGET UNTIL IT IS 

DESTROVED! 

GOOD LUCK ! I 



RADIANS FROM X AXIS = 6. 18367 FROM Z AXIS = 1. 0759 
APPROX DEGREES FROM X AXIS = 354 FROM Z AXIS = 61 
TARGET SIGHTED: APPROX COORDINATES X= 14882.5 V=~1485. 37 

ESTIMATED DISTANCE' 16398 
INPUT ANGLE DEVIATION FROM X, DEVIATION FROM Z, DISTANCE? 354,61,16996 

RADIANS FROM X AXIS = 6.17844 FROM 2 AXIS = 1. 06465 
SHOT BEHIND TARGET 104. 188 KILOMETERS. 
SHOT TO RIGHT OF TARGET 67. 6549 KILOMETERS. 
SHOT ABOVE TARGET 164.96 KILOMETERS. 

APPROX POSITION OF EXPLOSION: X= 14778, 3 V = -1553. 62 2= 8236.38 
DISTANCE FROM TARGET = 206.565. 



2= 8072. 02 



ESTIMATED DISTANCE' 1699 
INPUT ANGLE DEVIATION FROM X 



DEVIATION FROM 2, DISTANCE? 



RADIANS FROM X AXIS = 6.16972 FROM 2 AXIS =1.05592 
SHOT BEHIND TARGET 198.291 KILOMETERS. 
SHOT TO RIGHT OF TARGET 188.358 KILOMETERS. 
SHOT ABOVE TARGET 234. 319 KILOMETERS. 

APPROX POSITION OF EXPLOSION: X = 14692.2 V=-1674. 32 
DISTANCE FROM TARGET = 397.886 



ESTIMATED DISTANCE' 16995 
INPUT ANGLE DEVIATION FROM X, DEVIATION FROM 2, D1S 



2= 8366. 34 



a .<4 4. ei *. 1 »>**** 



RADIANS FROM X AXIS = 6. 18542 FROM 2 A! 
SHOT IN FRONT OF TARGET 23. 6373 KILOMETER, 
SHOT TO LEFT OF TARGET 24. 0381 KILOMETERS 
SHOT BELOW TARGET 40.3536 KILOMETERS. 
APPROX POSITION OF EXPLOSION: X= 14306.2 
DISTANCE FROM TARGET = 53. 0716 



<IS * 1. 87861 



2= 8031. 06 



ESTIMATED DISTANCE' 16995. ? 
INPUT ANGLE DEVIATION FROM X, DEVIATION FROM 



<:, 61. 9, 16996 



RADIANS FROM X AXIS = 6.18368 FROM 2 AXIS 
SHOT IN FRONT OF TARGET 35.9248 KILOMETERS. 
SHOT TO' RIGHT OF TARGET 3.45166 KILOMETERS. 
SHOT BELOW TARGET 66. 6372 KILOMETERS. 
APPROX POSITION OF EXPLOSION: X= 14918. 4 
DISTANCE; FROM TARGET = 75. 7828 



r'=-1489. 42 



2= 8005. 38 



ESTIMATED DISTANCE' 16335. 7 
INPUT ANGLE DEVIATION FROM X, DEVIATION FROM 2, 

RADIANS FROM X AXIS = 6. 18717 FROM 2 AXIS = 
SHOT IN FRONT OF TARGET 27. 1035 KILOMETERS. 
SHOT TO LEFT OF TARGET 43. 3703 KI LOMETERS. 
SHOT BELOW TARGET 40,4814 KILOMETERS. 
APPROX POSITION OF EXPLOSION: X- 14383.6 V= 
DISTANCE FROM TARGET = 63. 7882 



•■'■ .ESTIMATED, 'DISTANCE* 16335. 7 
INPUT ANGLE DEVIATION FROM X, DEVIATION FROM 2, 
ILLEGAL NUMBER AT LINE 460 
INPUT ANGLE DEVIATION FROM X, DEVIATION FROM 2, 



DISTANCE? 354. 



DISTANCE? 354. 6, 61. 3, 16336 



RADIANS FROM X AXIS = 6.48831 FROM Z AXIS = 1, 8803 
SHOT IN FRONT OF TARGET 43. 5186 KILOMETERS. v'-.\ 
SHOT TO LEFT OF TARGET 74. 681 KILOMETERS. 
SHOT BELOW TARGET 66. 6372 KILOMETERS. v 

APPROX POSITION OF EXPLOSION: X= 14326 V=~1411. 2£ 
DISTANCE FROM TARGET = 183.14 



215 



3D PLOT 



PLOTS A FAMILY OF CURVES 



Description 



3DPLOT will plot the family of curves of any function. The 
function Z is plotted as "rising" out of the x-y plane with 
x and y inside a circle of radius 30. The resultant plot looks 
almost 3 -dimensional. 

You set the function you want plotted in line 5. As with any 
mathematical plot, some functions come out "prettier" than 
others. Here are some that work nicely: 

5 DEF FNA(Z) = 30*EXP (-Z*Z/100) 

5 DEF FNA(Z) = SQR (900.01-Z*Z) *. 9-2 

5 DEF FNA(Z) = 30* (COS (Z/16) ) t2 

5 DEF FNA(Z) = 30-30*SIN (Z/18) 

5 DEF FNA(Z) = 30*EXP (-COS (Z/16) ) -30 

(Bessel function — Summerfeld's Integral) 

5 DEF FNA(Z) = 30*SIN (Z/10) 

One of the shortest programs submitted (14 lines) , 3DPL0T has 
to rank as perhaps the most clever. 

Program Author 

Mark Bramhall 

Digital Equipment Corp. 

Maynard, MA 01754* 




216 



PROGRAM LISTING 

5 DEF FNfl<2>=30*EXP<-2+2/100> 

190 PRINT 

140 FOR X = -30 TO 30 STEP 1. 5 

120 L=0 

110 Vl = 5*INT<SQRO00-X*X)/5) 

140 FOR V=V1 TO -VI STEP -5 

150 2=INT<25 + FNP,<SCR<X*X+V*V>>-. 7*V) 

160 IF 2<=L THEN 190 

170 L=2 

130 PRINT TflB(2)"*".i 

190 NEXT V 

200 PRINT 

2.10 NEXT X 

300 END 



SAMPLE RUN 

10 DEF FNA(7:> = 30*<COSCZ/16>>t2 

RUN 



10 DEF FNACZ)=30*EXPC-COS<Z/16>>-30 
•RUN 



* * * 
* *** 



*** 
* * 



* 


* * 


* 


*** 


* * * 


* 


* * * 


* 


* ** * 


* 


*** * 




* * * * 





5 DEF FNfl (2 )=30*EXP< -2*2/100) 
RUNNH 



** * 
* * 



* * 
* * 



* * 

* * 

* * 

* * 

* * 

* * 

* * 

* * 

* * 

** 



* * 
* * 



* * 
** * 






* + * * 



217 



TIC TAC 



TIC -TAG -TOE 



Description 



The game of tic-tac-toe hardly needs any introduction. In this 
one, you play versus the computer. Moves are entered by row 
number, a comma, and column number, as in the diagram below. 



1,1 1,2 1,3 
2,1 2,2 2,3 
3,1 3,2 3,3 



If you make any bad moves, the computer will win; if the com- 
puter makes a bad move, you can win; otherwise, the game ends 
in a tie. 

Source 

Seven games of tic-tac-toe were submitted. One notable one by 
Chase Ambler of the Asheville School plays the game on a VT05 
CRT terminal while an abbreviated one by Dana Noftle fits into 
an EduSystem 10. 

The one published was written by: 

Tom Kloos 

Oregon Museum of Science and Industry 

Portland, Oregon 97200 




218 



DCK) 
.ROW NUMBER., .COMMA, tf CQLUMN NUMBER, 



PROGRAM LISTING 

180 PRINT"YQU HAVE THE OPPORTUNITY OF TRYING TO BEAT THE COMPUTER" 

130 PRINT«AT TIC-TAC-TOE, ENTER YOUR MOVES AS FOLLOWS*" 

140 PRINT 

150 DIM CCll) 

160 DIM D(U) 

170 FOR K*t TO 11 

180 REAO COO, 

190 NEXT K 

200 PRINT H 

210 PRINT 

220 PRW'ROWS ARE HORIZONTAL (ACROSS) , f .COLUMNS ARE VERTICALCUP ♦ DOWN)" 

230 DIM B(9) 

240 DIM A(3,3) 

250 PRINT 

260 PRINT "NEW GAME STARTED NOW H 

270 FOR Jul TO 3 
260 FOR III TO 3 
290 LET A(I,J)*0 

300 NEXT I 

301 LET I»I-1 

310 NEXT J 

311 LET 4«J»1 
320 LET Zi 

330 PRINT "YOUR MOVE", 

340 INPUT R,C 

350 PRINT 

360 IF R»3 THEN 620 

370 IF C>3 THEN 620 

380 IF A(R,C) <> THEN 620 

390 LET A(R ( C)»-1 

400 GOSUB 1660 

410 IF Z »1 THEN 2070 

420 REM MACHINE MOVE,,, 

430 GOSUB 1100 

440 REM TEST FOR GAME WIN... 

450 GOSUB 1660 

460 IF Z»0 THEN 650 

470 REM PRINT GAME BOARD.. 

480 GO TO 490 

490 PRINT 

500 FOR Kit TO J 

510 LET B«A(K,U 

520 LET D»A(K,2) 

530 LET F*A(K,3) 

540 GOSUB 840 

550 IF K>2 THEN 570 

560 PRINT "***************" 

570 NEXT K 

571 LET KsK-1 
580 PRINT 

590 IF Z «>0 THEN 2070 

600 GO TO 330 

610 STOP 

620 PRINT »«* — ILLEGAL MOVE — TRY AGAIN -» — » 

630 PRINT 

640 GO TO 330 

650LET T2*0 

660 FOR J«l TO 3 

670 FOR 1*1 TO 3 

680 IF A(I,J)<>0 THEN 700 

690 LET T2*T2*1 

700 NEXT I 

701 LET 1*1-1 

710 NEXT J 

711 LET J*J-1 

720 IF T2>0 THEN 750 

730 GOSUB 1340 

740 GO TO 480 

750 IF T2M THEN 480 

760 FOR J»l TO 8 

770 IF B(J5«-2 THEN 800 

780 NEXT J 

781 LET J»J-1 
790 GO TO 730 
800 GOSUB 2000 
810 GO TO 480 

820 REM PRINT TIC*TAC»TQE BOARD ROW 

830 REM 

840 IF B<*0 THEN 910 

850 PRINT " * "7 

660 IF D«>0 THEN 940 

870 PRINT « * »t 

880 IF F<»0 THEN 970 

890 PRINT « " 

900 GO TO 1070 

910 IF B>0 THEN 1000 

920 PRINT "YOU * "7 

930 GO TO 860 

940 IF 0*0 THEN 1020 

950 PRINT "YOU * "I 

960 GO TO 680 

970 IF F>0 THEN 1040 

980 PRINT "YOU" 

990 GO TO 900 

1000 PR I NT "POP * "7 

1010 GO TO 860 

1020 PRINT "PDP * "J 

1030 GO TO 880 

1040 PRINT "POP" 

1050 GO TQ900 

1060 REM PRINT LEGENDS., 

1070 PRINT ».■*•*" 

1080 RETURN 

1090 REM PROGRAM TO MAKE MOVE FOR THE MACHINE,,,, 

1100 LET M«INTC3,33*RNDCM)) 

1110 LET N»INTC3,33333*RND(N)) 

1120 IF M»0 THEN 1100 

1130 IF M»3 THEN 1100 

1140 IF N«0 THEN 1110 

1150 IF N»3 THEN 1110 

1160 LET CC2)*M 

1170 LET D(2)*N 



219 



1180 LET CC3)*N 




1190 LET DC3)*M 




1200 FOR I«l TO 8 




1210 IF B(I)»1 THEN 1370 




1220 NEXT I 




1221 LET X*I-l 




1230 FOR 1*1 TO 8 




1240 IF BCI)*-1 THEN 1370 




1250 NEXT I 




1251 LET 1*1-1 




1260 IF R*C«0 THEN 1550 




1270 FOR Ml TO 11 




1280 LET I*CCK) 




i290 LET J«D0O 




1300 IF ACIf J)«»0 THEN 1330 




1310 LET ACI,J)*l 




1320 GO TO 1360 




1330 NEXT K 




1331 LET K»K*1 




1340 PRINT " ,,, TIE GAME ,,, « 




1350 LET Z*3 




1360 RETURN 




1370 IF 1*3 THEN 1440 




1380 FOR J«l TO 3 




1390 IF A(I,J)»0 THEN 1420 




1400 NEXT J 




1401 LET J*J-l 




1410 GO TO 1360 




1420 LET ACI,J)*1 




1430 GO TO 1360 




1440 IF I»6 THEN 1510 




1450 FOR J»l TO 3 




1460 IF A(J,I-3)*0 THEN 1490 




1470 NEXT J 




1471 LET J«J«1 




1480 GO TO 1360 




1490 LET ACJ, 1-33*1 




1500 GO TO 1360 




1510 IF I>7 THEN 1550 




1520 FOR J*l TO 3 




1530 IF A(J,J)*0 THEN 1590 




1540 NEXT J 




1541 LET J»J*1 




1550 IF A(l,3)*0 THEN 1610 




1560 IF A(3,l)*0 THEN 1630 




1570 LET A(2,2)*l 




1580 GO TO 1360 




1590 LET A(J,J)*1 




1600 GO TO 1360 




1610 LET A(l,3)*l 




1620 GO TO 1360 




1630 LET AC3,l)*i 




1640 GO TO 1360 




1650 REM PROGRAM TO TEST FOR GAME WINNER..,. 




1660 LET T1*0 




1670 FOR J*l TO 9 




1680 LET BU)*0 




1690 NEXT J 




1691 LET J*J-1 




1700 FOR J*l TO 3 




1710 FOR 1*1 TO 3 




1720 IF A(J,n«>A(J,n THEN 1750 




1730 NEXT I 




1731 LET I«I-1 




1740 LET T1*A(J,I) 




1750 NEXT J 




1751 LET J*JM 




1760 FOR J*l TO 3 




1770 FOR 1*1 TO 3 




1780 IF A(l, J)<»ACI,J) THEN 1810 




1790 NEXT I 




1791 LET I-I-l 




1800 LET T1"ACI,J) 




1810 NEXT J 




1811 LET J*J«1 




1820 IF A(l*l)aA(3,3) THEN 1930 




1830 IF A(3,1)*A(1,3) THEN 1970 




1840 IF T1<>0 THEN 1990 




1850 FOR J*l TO 3 




1860 FOR 1*1 TO 3 




1870 LET B(J)sB(J)*A(J,I) 




1880 LET B(J*3)"BCJ*3)*ACI,J) 




1890 NEXT I 




1891 LET I*IM 




1900 NEXT J 




1901 LET J*J*1 




1910 LET B(7)»AC1,1)*A(2,2)*A(3,3) 




1920 RETURN 




1930 IF A(2,2J»A(3,3J THEN 1950 




1940 GO TO 1830 




1950 LET T1*A(2,2) 




1960 GO TO 1840 




1970 IF A(2,2)*AC1,3) THEN 1950 




I960 GO TO 1840 




1990 IF T1>0 THEN 2030 




2000 PRINT " ,,,YOU WIN THIS TIME,,," 




2010 LET Z«l 




2020 GO TO 1850 




2030 PRINT " ... THE PDP*8 WINS THIS TIME .,,» 




2040 LET Z*2 




2050 GO TO 1850 




2060 REM END OF TEST WINNER PROGRAM,,,,,,, 




2070 PRINT "DO YOU WANT TO PLAY ANOTHER GAME: 


YESC1), 


2080 INPUT XI 




2090 IF XI * 1 THEN 250 




2100 IF XI ■ THEN 2130 




2110 PRINT "I SAID ONE OR ZEROS TRY AGAIN", 




2120 GO TO 2080 




2130 PRINT"IT»S BEEN FUN, COME AGAIN SOMETIME* 




2140 GO TO 2160 




2150 DATA 2,2,0,0,0,0,1,1,3,3,1,3,3,1,1,2,3,2, 


2,3,2,1 


2160 CHAIN "DEMON « 




2170 END 





NOC0)", 



SAMPLE RUN 

TICTAC EDUSYSTEM-35 

YOU HAVE THE OPPORTUNITY OF TRYING TO BEAT THE COMPUTER 
AT TIC-TAC-TOE. ENTER YOUR MOVES AS FOLLOWS: 

...ROW NUMBER. . .COMMA. . .COLUMN NUMBER... 

ROWS ARE HORIZONTAL<ACROSS).. .COLUMNS ARE VERTICAL(UO + DOWN) 

NEW GAME STARTED NOW 

YOUR MOVE ?3> 1 



************* 




* 


PDP 


* 




* 




* 


************* 


YOU 


* 




* 



YOUR MOVE ? 1 , 1 



*************** 
PDP * PDP * 



*************** 
YOU * * 



YOUR MOVE ?2,3 



*************** 
PDP * PDP * YOU 



*************** 
YOU * * PDP 



YOUR MOVE ?J,2 
... TIE GAME ... 

YOU * YOU * PDP 

* * 
*************** 
PDP * PDP * YOU 

* * 
*************** 
YOU * * PDP 



DO YOU WANT TO PLAY ANOTHER GAME: YES ( 1 ) , NO(0) 



220 



TOWER 



TOWERS OF HANOI PUZZLE 



Description 

This is a simulation of a game of logic that originated in the 
middle East. It is sometimes called Pharoah's Needles, but 
its most common name is the Towers of Hanoi. 

Legend has it that a secret society of monks live beneath the 
city of Hanoi. They possess three large towers or needles on 
which different size gold disks may be placed. Moving one at 
a time and never placing a larger on a smaller disk, the monks 
endeavor to move the tower of disks from the left needle to 
the right needle. Legend says when they have finished moving 
this 64-disk tower, the world will end. How many moves will 
they have to make to accomplish this? If they can move 1 
disk per minute and work 24 hours per day, how many years 
will it take? 



In the computer puzzle you are faced with three upright needles. 
On the leftmost needle are placed from two to seven graduated 
disks, the largest being on the bottom and smallest on the top. 
Your object is to move the entire stack of disks to the right- 
most needle. However, you may only move one disk at a time 
and you may never place a larger disk on top of a smaller one. 

In this computer game, the disks are referred 
to by their size — -i.e., the smallest is 3, 
next 5, 7, 9, 11, 13, and 15. If you play 
with fewer than 7 disks always use the largest, 
i.e. with 2 disks you would use nos. 13 and 
15. The program instructions are self- 
explanatory. Good luck I 

Program Author 

Charles Lund 

The American School 

Hague, Netherlands 




221 



PROGRAM LISTING 

90 PRINT 

180 REM *** INITIALIZE 

110 DIM T<7, 3> 

120 E=0 

130 FOR D=l TO 7 

140 FOR N=l TO 3 

150 T<D, N>=0 

160 NEXT N 

170 NEXT D 

180 PRINT "TOWERS OF HfiNOI PUZZLE "SPRINT 

200 PRINT "VOU MUST TRANSFER THE DISKS FROM THE LEFT TO THE RIGHT" 

205 PRINT "TOWER, ONE AT fl TIME, NEVER PUTTING ft LARGER ON A" 

210 PRINT "SMALLER DISK. "SPRINT 

215 PRINT "HOW MANV DISKS DO VOU WANT TO MOVE <7 IS MAX)"; 

220 INPUT SSPRINT 

230 M=0 

240 FOR Q=l TO 7 

250 IF Q=S THEN 350 

260 NEXT Q 

270 E=E+1 

280 IF E>2 THEN 310 

290 PRINT "SORRV, BUT I CAN'T DO THAT JOB FOR VOU. "SGOTO 215 

310 PRINT "ALRIGHT, WISE GUV, IF VOU CAN'T PLAV THE GAME RIGHT, I'LL" 

320 PRINT "JUST TAKE MV PUZZLE AND GO HOME. SO LONG. "\STOP 

348 REM *** STORE DISKS FROM SMALLEST TO LARGEST 

350 PRINT "IN THIS PROGRAM, WE SHALL REFER TO DISKS BV A NUMERICAL CODE. » 

355 PRINT "3 WILL REPRESENT THE SMALLEST DISK, 5 THE NEXT SIZE, 7 THE NEXT, ' 

360 PRINT "AND SO ON, UP TO 15. IF VOU DO THE PUZZLE WITH 2- DISKS, THEIR" 

365 PRINT "CODE NAMES WOULD BV 13 AND 15. WITH THREE DISKS, THE CODE" 

370 PRINT "NAMES WOULD BE 11, 13, AND 15, ETC. THE NEEDLES ARE" 

375 PRINT "NUMBERED FROM LEFT TO RIGHT, 1 TO 3. WE WILL START WITH THE " 

388 PRINT "DISKS ON NEEDLE 1, AND ATTEMPT TO MOVE THEM TO NEEDLE 3. " 

398 PRINTSPRINT "GOOD LUCK !! "SPRINT 

400 Y=7SD=15 

420 FOR X=S TO 1 STEP -1 

430 T<Y, 1>=DSD=D-2SY=V-1 

460 NEXT X 

470 GOSUB 1239 

488 PRINT "WHICH DISK WOULD VOU LIKE TO MOVE"; SE=0 

580 INPUT D 

510 IF <D-3>*<D-5)*<D-7)*<D-9)*<D-11)*<D-13)*<D-15)=0 THEN 5S'0 

520 PRINT "ILLEGAL ENTRV. . . VOU MAV ONLY TVPE 3,5,7,9,11,13, OR 15." 

538 E=E+1SIF E>1 THEN 56© 

550 GOTO 580 

560 PRINTSPRINT "STOP WASTING MV TIME. GO BOTHER SOMEONE ELSE. "SSTOP 

580 REM *** CHECK IF REQUESTED DISK IS BELOW ANOTHER 

598 FOR R = l TO 7 

600 FOR C=l TO 3 

610 IF T<R, C>=D THEN 640 

620 NEXT CSNEXT R 

640 FOR Q=R TO 1 STEP -1 

645 IF T<Q, C>»9 THEN 668 

650 IF T<0, CXD THEN 680 

66Q NEXT Q 

670 GOTO 700 

680 PRINT "THAT DISK IS BELOW ANOTHER ONE. MAKE ANOTHER CHOICE. "SGOTO 480 

700 E=0 

705 PRINT "PLACE DISK ON WHICH NEEDLE"; S INPUT N 

730 IF <N-l)*<N-2)*<N-3)=0 THEN 80S 

735 E-E+l 

740 IF E>1 THEN 780 

750 PRINT "I'LL ASSUME VOU HIT THE WRONG KEY THIS TIME. BUT WATCH IT," 

760 PRINT "I ONLV ALLOW ONE MISTAKE. "SGOTO 705 

780 PRINT "I TRIED TO WARN VOU, BUT VOU WOULDN'T LISTEN. " 

790 PRINT "BVE, BYE, BIG SHOT. "SSTOP 

795 REM *** LOCATE DISK TO BE MOVED 

880 FOR R=l TO 7 

818 IF T<R, N>O0 THEN 840 

828 NEXT R 

830 GOTO 880 

835 REM *** CHECK IF DISK TO BE PLACED ON A LARGER ONE 

840 IF D<T<R, N) THEN 880 

850 PRINT "VOU CAN'T PLACE A LARGER DISK ON TOP OF A SMALLER ONE. " 

860 PRINT "IT MIGHT CRUSH IT! "SPRINT "NOW THEN, "; SGOTO 480 

875 REM *** RELOCATE MOVED DISK 

880 FOR V=l TO 7SF0R W=l TO 3 

980 IF T<V, W)=D THEN 930 

918 NEXT WSNEXT V 

925 REM *** LOCATE FIRST EMPTY SPACE ON NEEDLE N 

930 FOR U=l TO 7 

940 IF T<U, N><>© THEN 97© 

950 NEXT U 

960 GOTO 980 

965 REM *** MOVE DISK AND SET OLD LOCATION TO 

970 U=U-1 

980 T < U, N > =T < V, W > ST < V, W ) =0 

995 REM +** PRINT OUT CURRENT STATUS 

1000 GOSUB 1230 

1010 REM *** CHECK IF DONE 

1020 M=M+1 

1030 FOR R=l TO 7SF0R C=l TO 2 

1050 IF T<R, OO0 THEN 1090 

1060 NEXT CSNEXT R 

1080 GOTO 1120 

1090 IF M<-128 THEN 480 

1100 PRINT "SORRV, BUT I HAVE ORDERS TO STOP IF VOU MAKE MORE THAN" 

1110 PRINT "128 MOVES. "SSTOP 

1120 IF M02-S-1 THEN 1140 

1130 PRINT "CONGRATULATIONS! ! "; 

1140 PRINT "VOU HAVE PERFORMED THE TASK IN"M"MOVES. " 

1150 PRINTSPRINT "TRY ANOTHER ONE <VES OR NO) ";S INPUT A* 

1168 IF A*="NO" THEN 1390 

1170 IF A*="VES" THEN 9© 

1180 PRINTSPRINT "'YES' OR 'NO' PLEASE"; SI NPUT A*SGOTO 116© 

1238 REM *** PRINT SUBROUTINE 

1240 FOR K=l TO 7 

1250 2=10 

1260 FOR J=l TO 3 

1270 IF T<K, J>=© THEN 1330 

1288 PRINT TAB<Z-INT<T<K, J)/2)); 

1290 FOR V=l TO T<K, J) 

1300 PRINT "*"; 

1310 NEXT V 

1328 GOTO 1340 

1338 PRINT TABXZ); "*"; 

1340 2=2+21 

1350 NEXT J 

1360 PRINT 

1370 NEXT K 

1380 RETURN 

1390 PRINTSPRINT "THANKS FOR THE GAME ! "SPRINTSEND 



SAMPLE RUN 

TOWERS OF HANOI PUZZLE 

VOU MUST TRANSFER THE DISKS FROM THE LEFT TO THE RIGHT 
TOWER, ONE AT A TIME, NEVER PUTTING A LARGER ON A 
SMALLER DISK. 

HOW MANV DISKS DO YOU WANT TO MOVE <7 IS MAX)? 3 

IN THIS PROGRAM, WE SHALL REFER TO DISKS BY A NUMERICAL CODE. 

3 WILL REPRESENT THE SMALLEST DISK, 5 THE NEXT SIZE, 7 THE NEXT, 

AND SO ON, UP TO 15. IF YOU DO THE PUZZLE WITH 2 DISKS, THEIR 

CODE NAMES WOULD BY 13 AND 15. WITH THREE DISKS, THE CODE 

NAMES WOULD BE 11, 13, AND IS, ETC. NEEDLES ARE 

NUMBERED FROM LEFT TO RIGHT, 1 TO 3. WE WILL START WITH THE 

DISKS ON NEEDLE 1, AND ATTEMPT TO MOVE THEM TO NEEDLE 3. 

GOOD LUCK! ! 



*********** n- 

************* * 

*************** * 

WHICH DISK WOULD VOU LIKE TO MOVE? 11 
PLACE DISK ON WHICH NEEDLE? 3 



************* * 

*************** * 

WHICH DISK WOULD YOU LIKE TO MOVE? 13 
PLACE DISK ON WHICH NEEDLE? 2 



*************** ************* 
WHICH DISK WOULD YOU LIKE TO MOVE? 11 
PLACE DISK ON WHICH NEEDLE? 2 



* * * * * * * * * * * 



* * * * * * * * * * * 



************* 
WHICH DISK WOULD 
PLACE DISK ON WH 



* * * * * * * * * * * 
* * * * * * * * * * * * * * 
VOU LIKE TO MOVE? 15 
ICH NEEDLE? 3 



WHICH DISK WOULD 
PLACE DISK ON WH 



*********** 
************* 
VOU LIKE TO MOVE? 11 
ICH NEEDLE? 1 






WHICH DISK WOULD 

ILLEGAL ENTRV. 

? 13 

PLACE DISK ON WHICH NEEDLE? 3 



* * * * * * * * * * * * * 
VOU LIKE TO MOVE? 12 
YOU MAY ONLV TVPE 3, 5, 7, 



WHICH DISK WOULD 
PLACE DISK ON WH 



VOU LIKE TO MOVE? 11 
ICH NEEDLE? 3 



* * * * * * * * * * * * * * * 



9,11,13, OR 15. 



* * * * * * * * * * * * * * * 



CONGRATULATIONS! 



* *********** 

* * * * * * * * * * * * * * 

* *************** 

VOU HAVE PERFORMED THE TASK IN 7 MOVES. 



222 



TRAIN 



TIME-SPEED-DISTANCE QUIZ 



Description 

TRAIN is a program which uses the computer to generate problems 
with random initial conditions to teach about the time-speed- 
distance relationship (distance = rate x time). You then input 
your answer and the computer verifies your response. 

TRAIN is merely an example of a student-generated problem. 
Maximum fun (and benefit) comes more from writing programs 
like this as opposed to solving the specific problem posed. 
Exchange your program with others - you solve their problem 
and let them solve yours. 

Source 

TRAIN was originally written in FOCAL by one student for use 
by others in his class. It was submitted to us by: 

Walt Koetke 
Lexington High School 
Lexington, Mass. 02173 



4 PRINT "TIME - SPEED - DISTANCE EXERC I SE » SPR I NT 

5 RANDOMIZE 

10 C=INT(RND*25)+40 
15 D=INT(RND*15)+5 

29 T=INT(RND*19)+20 

25 PRINT " A CAR TRAVEL I NG"C"MPH CAN MAKE A CERTAIN TR 

30 PRINT D" HOURS LESS THAN A TRAIN TRAVELING' AT"T H MPH. 
35 PRINT "HOW LONG DOES THE TRIP TAKE BV CAR".; 

40 INPUT A 

45 V=D*T/(C-T) 

50 E=INT<ABS((V-A)*100/A)+. 5) 

55 IF E>5 THEN 70 

60 PRINT "GOOD! ANSWER WI TH I N "E "PERCENT. " 

65 GOTO 80 

70 PRINT "SORRV. YOU WERE OFF BV" E" PERCENT. " 

80 PRINT "CORRECT ANSWER IS " V" HOURS. " 

90 PRINT 

95 PRINT "ANOTHER PROBLEM (YES OR N0>".; 

100 INPUT ASSPRINT 

105 IF A*="VES" THEN 10 

999 END 

READY 

RUN 

TRAIN 04:16 PM 08-MAV-73 

TIME - SPEED - DISTANCE EXERCISE 

A CAR TRAVELING 44 MPH CAN MAKE A CERTAIN TRIP IN 
14 HOURS LESS THAN A TRAIN TRAVELING AT 24 MPH. 

HOW LONG DOES THE TRIP TAKE BV CAR? 16.8 

GOOD! ANSWER WITHIN PERCENT. 

CORRECT ANSWER IS 16.8 HOURS. 



ANOTHER PROBLEM (VES OR NO) 



VES 



A CAR TRAVELING 55 MPH CAN MAKE A CERTAIN TRIP IN 

10 HOURS LESS THAN A TRAIN TRAVELING AT 3:4 MPH. 
HOW LONG DOES THE TRIP TAKE BV CAR? 16:2 

GOOD! ANSWER WITHIN PERCENT. 
CORRECT ANSWER IS 16.1905 HOURS. 

ANOTHER PROBLEM (VES OR NO)? VES 

A CAR TRAVELING 40 MPH CAN MAKE A CERTAIN TRIP IN 

11 HOURS LESS THAN A TRAIN TRAVELING AT 24 MPH. 
HOW LONG DOES THE TRIP TAKE BV CAR? 15.5 
SORRV. VOU WERE OFF BV 6 PERCENT. 

CORRECT ANSWER IS 16.5 HOURS. 

ANOTHER PROBLEM (VES OR NO)? NO 





iifiiist 



^^^^B 





223 



TRAP 



TRAP A MYSTERY NUMBER 



Description 



Another of the family of "guess the mystery number" games, in 
TRAP the computer selects a random number between 1 and 100 
(or other limit set in statement 20) . Your object is to find 
the number. On each guess, you enter 2 numbers trying to 
trap the mystery number between your two trap numbers. The 
computer will tell you if its number is larger or smaller 
than your trap numbers or if you have trapped the number. 

To win the game, you must guess the mystery number by entering 
it as the same value for both of your trap numbers. You get 
6 guesses (this should be changed in statement 10 if you 
change the guessing limit in statement 20). 

After you have played GUESS, STARS, and TRAP, compare the 
guessing strategy you have found best for each game. Do you 
notice any similarities? What are the differences? Can you 
write a new guessing game with still another approach? 

Program Author 

TRAP was suggested by 10-year old when he was playing GUESS. 
It was originally programmed by Steve Ullman and extensively 
modified into its final form by: 

Bob Albrecht 

People ' s Computer Co . 

Menlo Park, CA. 94025 




224 



PROGRAM LISTING 



SAMPLE RUN 



TRAP 



EDUSVSTEM 38 



10 G = 6 

28 N = 108 

30 REM-TRflP 

40 REM-STEVE ULLMRN, 8-1-72 

58 PRINT "WANT INSTRUCTIONS (1 FOR YES)"; 

68 INPUT 2 

THEN ISO 
"I AM THINKING OF fl NUMBER BETWEEN 1 AND";N 
"TRY TO GUESS MY NUMBER. ON EACH GUESS, " 
"VOL! ARE TO ENTER 2 NUMBERS, TRYING TO TRAP" 
"MV NUMBER BETWEEN THE TWO NUMBERS. I WILL" 
"TELL YOU IF YOU HAVE TRAPPED HIV NUMBER, IF MV" 
"NUMBER IS LARGER THAN YOUR TWO NUMBERS, OR IF" 
"MY NUMBER IS SMALLER THAN YOUR TWO NUMBERS. " 
"IF YOU WANT TO GUESS ONE SINGLE NUMBER, TYPE" 
"YOUR GUESS FOR BOTH YOUR TRAP NUMBERS. " 
"YOU GET"; 6; "GUESSES TO GET MV NUMBER." 



88 

38 

100 
110 
128 

138 
140 
150 
168 



IF 201 
PRINT 
PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 

PRINT 
188 X=INT<N*RND<8>)+1 
190 FOR 6=1 TO G 
200 PRINT 

210 PRINT "GUESS #";C 
220 INPUT A, B 
230 IF ROB THEN 248 
235 IF X = A THEN 400 
240 IF A<=B THEN 268 
250 GOSUB 360 
268 IF X<fl THEN 300 
278 IF X<-B THEN 328 
280 PRINT "MY NUMBER 
290 GOTO 330 
380 PRINT "MV NUMBER 
310 GOTO 330 

320 PRINT "YOU HAVE TRAPPED MV NUMBER 
330 NEXT Q 

340 PRINT "SORRY, THAT 
350 GOTO 410 
368 Ra'fl 
378 A = B 
380 B=R 
390 RETURN 

400 PRINT "YOU GOT IT! 
410 PRINT 

420 PRINT "TRY AGAIN. " 
438 PRINT 
440 GOTO ISO 
458 END 



IS LARGER THAN YOUR TRAP NUMBERS. 



IS SMALLER THAN YOUR TRAP NUMBERS 



GUESSES. NUMBER WAS" 



TRRP 



EDUSVSTEM 38 



WANT INSTRUCTIONS <1 FOR VES)?1 

I RM THINKING OF A NUMBER BETWEEN 1 AND 188 

TRV TO GUESS MV NUMBER. ON EACH GUESS, 

YOU ARE TO ENTER 2 NUMBERS, TRYING TO TRAP 

MY NUMBER BETWEEN THE TWO NUMBERS. I WILL 

TELL YOU IF YOU HAVE TRAPPED MV NUMBER, IF MY 

NUMBER IS LARGER THAN YOUR TWO NUMBERS, OR IF 

MY NUMBER IS SMALLER THAN YOUR TWO NUMBERS. 

IF YOU WANT TO GUESS ONE SINGLE NUMBER, TYPE 

YOUR GUESS FOR BOTH YOUR TRAP NUMBERS. 

YOU GET 6 GUESSES TO GET MV NUMBER. 

GUESS # 1 ?33,67 

MV NUMBER IS SMALLER THAN VOUR TRAP NUMBERS. 

GUESS # 2 ?11, 22 

MY NUMBER IS LARGER THAN VOUR TRAP NUMBERS. 

GUESS # 3 ?25, 28 

MV NUMBER IS SMALLER THAN VOUR TRAP NUMBERS. 

GUESS # 4 ?23, 23 
YOU GOT IT! ! I 

TRV AGAIN. 



GUESS # 1 ?33,67 

MV NUMBER IS SMALLER THAN VOUR TRAP NUMBERS. 



GUESS # 2 ?11,22 

MV NUMBER IS LARGER THAN VOUR TRAP NUMBERS 



GUESS # 3 ?25, 28 

VOU HAVE TRAPPED MV NUMBER. 



GUESS # 4 ?26,26 

MV NUMBER IS LRRGER THAN VOUR TRAP NUMBERS. 



GUESS # 5 ?27, 27 
YOU GOT IT! ! ! 



GUESS # 1 ?33, 67 

YOU HAVE TRAPPED MV NUMBER. 



GUESS # 2 ?44,56 

MV NUMBER IS SMALLER THAN VOUR TRAP NUMBERS 



GUESS # 3 ?37, 48 

YOU HRVE TRAPPED MY NUMBER. 



GUESS # 4 ?38, 38 

MV NUMBER IS SMALLER THAN VOUR TRAP NUMBERS. 



GUESS # 5 ?37, 37 
YOU GOT IT! ! ! 



225 



23 MTCH 



GAME OF 23 MATCHES 



Description 



In the game of twenty- three matches, you start with 23 matches 
lying on a table. On each turn, you may take 1, 2, or 3 matches. 
You alternate moves with the computer and the one who has to 
take the last match loses. 

The easiest way to devise a winning strategy is to start at 
the end of the game. Since you wish to leave the last match 
to your opponent, you would like to have either 4, 3, or 2 
on your last turn so you can take away 3, 2, or 1 and leave 
1. Consequently, you would like to leave your opponent with 
5 on his next to last turn so, no matter what his move, you 
are left with 4, 3, or 2. Work this backwards to the begin- 
ning and you'll find the game can effectively be won on the 
first move. Fortunately, the computer gives you the first 
move, so if you play wisely, you can win. 

After you've mastered 23 Matches, move on to BATNUM and then 
to NIM. 

Program Author 

Raymond Burhitt of Plainedge H.S., N. Massapeque, N.Y. submitted 
one version of 23 Matches, however, the one published is from: 

Bob Albrecht 
People's Computer Co. 
Menlo Park, CA. 94025 




226 



PROGRAM LISTING 



190 REM +++23 MATCHES 

110 PRINT "LET'S PLAV 22. MATCHES. WE START WITH 23 MATCHES. 

1.15 PRINT "VOU MOVE FIRST. VOU MAY TAKE 1,2 OR 3 MATCHES. " 

120 PRINT "THEN I MOVE... I MAV TAKE 1,2 OR 3 MATCHES. " 

125 PRINT "VOU MOVE, I MOVE AND SO ON. THE ONE WHO HAS TO" 

130 PRINT "TAKE THE LRST MATCH LOSES. " 

135 PRINT "GOOD LUCK AND MAV THE BEST COMPUTER (HA HA> WIN. 

140 PRINT 

150 LET M=23 

200 REM +++THE HUMAN MOVES 

205 PRINT 

210 PRINT "THERE ARE NOW ".; M.; "MATCHES. " 

215 PRINT 

220 PRINT "HOW MANV DO VOU TAKE".; 

230 INPUT H 

240 IF H>M THEN 510 

250 IF HOINT<H> THEN 510 

2«50 IF H< = THEN 51© 

270 IF H>=4 THEN 510 

280 LET M=M-H 

290 IF M=0 THEN 410 

300 REM +++THE COMPUTER MOVES 

305 IF M=l THEN 440 

310 LET R = M-4* INT CM/4. > 

320 IF ROl THEN 350 

330 LET C=INT(3+RND(0>>+1 

340 GO TO 360 

350 LET C='::R+3)-4+INT(<R + 3)/4) 

360 LET H = M-C 

370 IF M=0 THEN 440 

375 PRINT 

380 PRINT "I TOOK".;C; "..."; 

390 GO TO 210 

400 REM ***SOMEBODV WON (SEE LINES 290,205,370) 

410 PRINT 

420 PRINT "I- WON!!! BETTER LUCK NEXT TIME." 

430 GO TO 140 

440 PRINT 

450 PRINT "O.K. SO VOU WON. LET'S PLAV AGAIN. " 

460 GO TO 140 

500 REM +++THE HUMAN CHEATED! (SEE LINES 240 THRU 270) 

510 PRINT "VOU CHEATED! BUT I'LL GIVE VOU ANOTHER CHANCE. " 

520 GO TO 215 

999 END 



SAMPLE RUN 

23MTCH EDUSVSTEM 30 

LET'S PLAV 23 MATCHES. WE START WITH 22 MATCHES. 
VOU MOVE FIRST. VOU MAV TAKE 1,2 OR 3 MATCHES 
. THEN I MOVE. . . I MAV TAKE 1, 2 OR 3 MATCHES. 
VOU MOVE, I MOVE AND SO ON. THE ONE WHO HAS Tfi 
TAKE THE LAST MATCH LOSES. 
GOOD LUCK AND MAV THE BEST COMPUTER (HA HA) WIN. 

THERE ARE NOW 23 MATCHES. 

HOW MANV DO VOU TAKE?3 

I TOOK 3 . . . THERE ARE NOW 17 MATCHES. 

HOW MANV DO VOU TAKE21 

I TOOK 3 ... THERE ARE NOW 13 MATCHES. 

HOW MANV DO VOU TAKE22 

I TOOK 2 . . . THERE ARE NOW 9 MATCHES. 

HOW MANV DO VOU TAKE71 

I TOOK 3 . . . THERE ARE NOW 5 MATCHES. 

HOW MANV DO VOU TAKE21 

I TOOK 3 . . . THERE ARE NOW 1 MATCHES. 

HOW MANV DO VOU TAKE?© 

VOU CHEATED! BUT I'LL GIVE VOU ANOTHER CHANCE 

HOW MANV DO VOU TAKE?1 

I WON!!! BETTER LUCK NEXT TIME. 

THERE ARE NOW 23 MATCHES. 

HOW MANV DO VOU TAKE?2 

I TOOK 1 . . . THERE ARE NOW 20 MATCHES. 

HOW MANV DO VOU TAKE23 

1 TOOK! ... THERE ARE NOW 16 MATCHES. 

HOW MANV DO VOU TAKE23 

I TOOK 2 . . . THERE ARE NOW 11 MATCHES. 

HOW MANV DO VOU TAKE?2 

I TOOK 3 ../THERE ARE NOW 6 MATCHES. 

HOW MANV DO V U T A K E ? 1 

I TOOK 3 ...THERE ARE NOW 2 MATCHES. 

HOW MANV Dp VOU TAKE?! 

0. K. SO VOU WON. LET'S PLAV AGAIN. 



227 



UGLY 



DRAWS AN UGLY WOMAN 



Description 

This program draws on the terminal the profile of a woman. 
It gives you an opportunity to specify the "dimensions" of 
your woman (termed SPECIAL) or take your chances (CHANCE) . 

The computer draws your figure and then makes a determination 
whether or not to call your woman ugly or just leave it up to 
your own judgement. 

Program Author 

Mark Maslar 

231 Apple tree Drive 

Media, PA. 19063 




228 



PROGRAM LISTING 



SAMPLE RUN 



5 PRINT "PROGRAM ' UGLV'" SPRINT 

6 D = 1SE = 1SF = 1'\PRINT "DO YOU WANT CHANCE ( 1 ), OR SPECIflL<2>" 

7 INPUT G 

3 IF G=2 THEN 17 

9 RANDOMIZE 

10 R=INT<40*RND>+15 

11 B=INT<40*RND)+10 

12 C=INT<40+RND>+15 

13 PRINT "A="A, "B="B, "C="C 

14 PRINT "DO VOU STILL WANT CHANCE — 1 FOR YES, 2 FOR NO" 

15 INPUT H 

16 ON H GOTO 19, 6 

17 PRINT "WHAT ARE VOUR VALUES FOR A, B, AND C"; 
13 INPUT A, B,C 

19 PRINTSPRINTSPRINT TAB (20) "XXX" 

29 PRINT TAB<:i9)"XXXXX" 
25 PRINT TAB (20)" XXX" 

30 PRINT TAB<21)"X" 
35 PRINT TflB(15)"X"j • 
40 D-D+l 

45 PRINT "X".; 

50 IF D>=A-2 THEN 60 

55 GOTO 40 

60 PRINT "X" 

65 PRINT TAB<15)"X".; 

70 D = l 

75 D=D+1 

80 PRINT "X".; 

85 IF D=A-1 THEN 95 

90 GOTO 75 

95 PRINT "X>. " 

100 PRINT TAB(15)"X".; 

105 D=l 

110 D=D+1 

115 PRINT "X".; 

120 IF D>=R~2 THEN 120 

125 GOTO 110 

130 PRINT "X" 

135 PRINT TRB<15) H X".; 

140 E = E + 1 

150 PRINT "X".; 

155 IF E=B~1 THEN 165 

160 GOTO 140 

165 PRINT "X" 

170 PRINT TAB(15)"X".; 

175 E=l 

180 E=E+1 

135 PRINT "X".; 

190 IF E=B~1 THEN 205 

200 GOTO 1:30 

205 PRINT "X" 

210 PRINT TAB <15)"X".; 

215 E=l 

220 E=E+1 

225 ..PRINT "X"; 

230 IF E=B-i THEN 240 

235 GOTO 220 

240 PRINT "X" 

245 PRINT TAB<15)"X".; 

250 F = F + 1 ... 

255 PRINT "X".; 

260 IF F>»C-2 THEN 270 

265 GOTO 250 

270 PRINT "X" 

275 PRINT TAB(15>"X".: 

230 F=l 

285 F=F+1 

290 PRINT "X".; 

295 IF F=C-1 THEN 305 

300 GOTO 285 

305 PRINT "X" 

310 PRINT TRB<15>"X".; 

315 F=l 

316 GOTO 320 

317 F = F + 3 
320 F*F+1 

325 PRINT "X".; 

327 IF F = 7. THEN 329 

328 GOTO 331 

329 PRINT " O".: 

330 GOTO 317 

331 IF F=C-1 THEN 240 
335 GOTO 320 

340 PRINT "X" 

345 PRINT TABC19)"XX XX" 

350 PRINT TAB (18) "XX XX" 

355 PRINT TAB (17) "XX XX'" 

360 PRINT TAB i 16) "XX XX" 

365 PRINT TAB (15.) "XX XX" 

370 PRINT TAB < 13)" XXXX XXXX" 

380 PRINTSPRINT 

335 IF B<A THEN 6 

295 FOR X = l TO 48 

400 PRINT "UGLV! "; 

405 NEXT X 

407 PRINTSPRINT 

410 GOTO 6 

415 END 



PROGRAM -'UGLY' 

DO VOU WANT CHANCE (1), OR SPEC I AL <2>? 

A= 21 B= 46 C= 52 

DO VOU STILL WANT CHANCE — 1 FOR YES, 



XXX 

XX XXX 

XXX 

■X 



FOR NO? 1 



XXXXXXXXXXXXXXXXXXXX 
XXXXXXXXXXXXXXXXXXXXX ) . 
XXXXXXXXXXXXXXXXXXXX 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

xxxxxxxoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

XX XX 



UGLY! UGLV! UGLY 

UGLY! UGLY! UGLV 

UGLY) UGLV! UGLV 

UGLV! UGLV! UGLV 



XX 



UGLY ! 
UGLY ! 
UGLV ! 
UGLV ! 



XX 
XX 



XX 
XXXX 



UGLV ! 
UGLV ! 
UGLV! 
UGLV ! 



UGLV! 
UGLV! 
UGLV ) 
UGLV ! 



UGLV! 
UGLV ! 
UGLV ! 
UGLV! 



UGLV ! UGLV ! 

UGLV! UGLV! 

UGLV! UGLY! 

UGLV ! UGLV ! 



UGLV! UGLV! UGLV! 

UGLV! UGLV! UGLV! 

UGLV! UGLV! UGLV! 

UGLV! UGLV! UGLV! 



DO VOU WANT CHANCE <!).. OR SPEC I AL (2)? 

fl= 19 B= 25 C- 24 

DO YOU STILL WANT CHANCE — 1 FOR VES, 

DO VOU WANT CHANCE <1), OR SPEC I AL (2)? 

A= 25 B= 26 C= 24 

DO VOU STILL WANT CHANCE — 1 FOR YES, 

DO YOU WANT CHANCE <1), OR SPECIAL (2)? 

WHAT ARE VOUR VALUES FOR A, B, AND C? 



2 FOR NO? 2 



2 FOR NO? 



XX 


XX 


XX 


XX 


XXXX 


XXXX 



READY 



229 



WAR 



CARD GAME OF WAR 



Description 



This program plays the card game of War. In War, the card 
deck is shuffled, then two cards are dealt, one to each 
player. Players compare cards and the higher card (numeri- 
cally) wins. In case of tie, no one wins. The game ends 
when you have gone through the whole deck (52 cards, 26 
games) or when you decide to quit. 

The computer gives cards by suit and number, for example, 
5-7 is the 7 of spades. 

Note: The fG in some of the PRINT statements (470,650) 
indicates the ringing of the teletype bell. 

Source 

This program showed up on a DIGITAL in-house DECsystem-10 
one day. The author is unknown. 




230 



PROGRAM LISTING 



EACH CARD IS GIVEN BY SUIT«#"| 



A tCARDi, THE HIGHER «CARD« 



1 REM THIS PROGRAM PLAYS THE CARD GAME OF WAR. THE ONLY CHANGE 

2 REM IS THAT A TIE, MAKES NO SCORE AT ALL. THE PACK IS READ IN 

3 REM AND THEN SHUFFLES IN A RANDOM WAY, THE COMPUTER THEN DEALS THE 

4 REM CARDS TWO AT A TIME AS LONG AS THE GAME CONTINUES, A RUNNING 

5 REM SCORE IS KEPT, 

100 PRINT "THIS IS THE CARD GAME OF WAR. 
110 PRINT "AS S-7 FOR SPADE 7. "f 
120 PRINT "DO YOU WANT DIRECTIONS" > 
130 INPUT BS 
140 IF BS"»NO" THEN 210 
150 IF BS="YES" THEN 180 
160 PRINT "YES OR NO, PLEASE. "> 
170 GO TO 120 

180 PRINT "THE COMPUTER GIVES YOU AND IT 

190 PRINT "(NUMERICALLY) WINS. THE GAME ENDS WHEN YOU CHOOSE NOT" J 
200 PRINT " TO CONTINUE OR WHEN YOU HAVE FINISHED THE PACK," 

210 PRINT 

220 PRINT 

230 DIM ASC52), L(54) 

240 FOR I»l TO 52 

250 READ ASCI) 

260 NEXT I 

270 RANDOM 

280 FOR J*l TO 52 

290 LET L(J)«*INTC52#RNDCX) + 1) 

300 FOR K»l TO J-l 

310 IF LCK)OL(J) THEN 340 

320 LET JeJ-1 

330 GO TO 350 

340 NEXT K 

350 NEXT J 

360 LET P»P+1 

370 LET MleLCP) 

380 LET PsP+i 

390 LET M2aLCP) 

400 PRINT 

410 PRINT 

420 PRINT "YOUI «>A$(M1)# "COMPUTER! »fA$CM23, 

430 LET Nl»lNT(CMl-.5)/43 

440 LET N2=INT(CM2-,5)/4) 

450 IF Nl>aN2 .THEN 490 

460 LET A1*A1+1 

470 PRINT "COMPUTER WINS , *G*G W G"G*G YOU HAVE" >Bir" > COMPUTER HAS»|A1 

480 GO TO 540 

490 IF N1=N2 THEN 530 

500 LET Bi«Bl+l 

510 PRINT "YOU WIN, YOU HAVE">Blj"j COMPUTER HAS»jAl 

520 GO TO 540 

530 PRINT "TIE, NO SCORE CHANGE," 

540 IF LCP+1)»0. THEN 610 

550 PRINT "DO YOU WANT TO CONTINUE"? 

560 INPUT V$ 

570 IF V$»"XES» THEN 360 

580 IF V$="NO"THEN 650 

590 PRINT "YES OR NO, PLEASE, "j 

600 GO TO 540 

610 PRINT 

620 PRINT 

630 PRINT "YOU HAVE RUN OUT Of CARDS, 

640 PRIMT_J , J_COMPUTER»-"iA.t 

650 PRINT "THANKS FOR PLAYING, IT WAS FUN,*G"G" 

660 DATA S-2,H-2,C-2,D-2,S-3,H-3,C-3,D-3,S«4,H<'4,C'-4,D-4,S«5,H-5,C-5 

670 DATA D-5,S-6,H-6,C-6,D-6,S-7,H«7,07,D-7,S-8,H»8,C-8,D-8,S»9,H«9 

680 DATA C-9#D-9,S"10#H-10,C"10#D-10,S-J,H-J,'C-J,D»J,S-Q,H-Q,C-Q»D-Q 

690 DATA S-K,H-K,C-K,D«K,S«A,H-A,C-A,D-A 

700 END 



FINAL. SCORE! YOU- 



311 



VOU: C-5 COMPUTER: D-4 

VOU WIN. VOU HAVE 5 ; COMPUTER HAS 1 

DO VOU WANT TO CONTINUE ?VES 



VOU: C--6 COMPUTER: S-A 

COMPUTER WINS. VOU HAVE 5 ; COMPUTER HAS 2 

DO VOU WANT TO CONTINUE ?VES 



VOU: S-K COMPUTER: H-10 

VOU WIN. VOU HAVE 6 ) COMPUTER HAS 2 

DO VOU WANT TO CONTINUE ?VES 



VOU: S-4 COMPUTER: D-A 

COMPUTER WINS. VOU HAVE 6 ; COMPUTER HAS 3 

DO VOU WANT TO CONTINUE ?VES 



VOU: C-3 COMPUTER: S-2 

VOU WIN. VOU HAVE 7 ; COMPUTER HAS 3 

DO VOU WANT TO CONTINUE ?VES 



VOU: C-J COMPUTER: H-K 

COMPUTER WINS. VOU HAVE 7 ; COMPUTER HAS 4 

DO VOU WANT TO CONTINUE ?VES 



VOU: H~6 COMPUTER: C-A 

COMPUTER WINS. VOU HAVE 7 ; COMPUTER HAS 

DO VOU WANT TO CONTINUE ?VES 



VOU: C-Q COMPUTER: C-2 

VOU WIN. VOU HAVE 8 ; COMPUTER HAS 5 

DO VOU WANT TO CONTINUE ?VES 



VOU: S-5 COMPUTER: C-7 

COMPUTER WINS. VOU HAVE 8 i COMPUTER HAS 6 

DO VOU WANT TO CONTINUE ?VES 



VOU: H-5 COMPUTER: D-10 

COMPUTER WINS. VOU HAVE 8 ; COMPUTER HAS 7 

DO VOU WANT TO CONTINUE ?VES 



VOU: H-A COMPUTER: C-9 

VOU WIN. VOU HAVE 9 ; COMPUTER HAS 7 

DO VOU WANT TO CONTINUE ?VES 



VOU: H-Q COMPUTER: D-6 

VOU WIN. VOU HAVE 10 .; COMPUTER HAS 7 

DO VOU WANT TO CONTINUE ?VES 



VOU: H-8 COMPUTER: D-K 

COMPUTER WINS. VOU HAVE 10 ; COMPUTER HAS 8 

DO VOU WANT TO CONTINUE ?VES 



VOU: S~7 COMPUTER: H-4 

VOU WIN. VOU HAVE 11 ; COMPUTER HAS 8 

DO VOU WANT TO CONTINUE ?VES 



SAMPLE RUN 

THIS IS THE CARD GAME OF WAR. EACH CARD IS GIVEN BV SUIT 
AS S-7 FOR SPADE 7. DO VOU WANT DIRECTIONS ?VES 
THE COMPUTER GIVES VOU AND IT A' CARD" . THE HIGHER ' CARD' 
< NUMER I CALL V > W I NS. THE GAME ENDS WHEN VOU CHOOSE NOT 
TO CONTINUE OR WHEN VOU HAVE FINISHED THE PACK. 



VOU : S- J COMPUTER : H- J 

TIE. NO SCORE CHANGE. 

DO VOU WANT TO CONTINUE ?VES 



VOU: S-0. COMPUTER: D-Q 

TIE. NO SCORE CHANGE. 

DO VOU WANT TO CONTINUE ?VES 



VOU: D-2 COMPUTER: D-2 

VOU WIN. VOU HAVE 1 ; COMPUTER HAS 

DO VOU WANT TO CONTINUE ?VES 



VOU: :.H-3 COMPUTER: D-8 

COMPUTER WINS. VOU HAVE 1 ; COMPUTER HAS 1 

DO VOU WANT TO CONTINUE ?VES 



VOU: H-9 COMPUTER: C-8 

VOU WIN. VOU HAVE 2'; COMPUTER HAS 1 

DO VOU WANT TO CONTINUE ?VES 



VOU: D-J COMPUTER: C-10 

VOU WIN. VOU HAVE 2 ; COMPUTER HAS 1 

DO VOU WANT TO CONTINUE ?VES 



VOU: C-4 COMPUTER: H-2 

VOU WIN. VOU HAVE 12 ; COMPUTER HAS 8 

DO VOU WANT TO CONTINUE ?VES 



VOU : S-3 COMPUTER : S-6 

COMPUTER WINS. VOU HAVE 12 ; COMPUTER HAS 9 

DO VOU WANT TO CONTINUE ?VES 



VOU: H--7 COMPUTER: S-8 

COMPUTER WINS. VOU HAVE 12 ; COMPUTER HAS 10 

DO VOU WANT TO CONTINUE ?VES 



VOU: C-K COMPUTER: D-5 

VOU WIN. VOU HAVE ±3 i COMPUTER HAS 10 

DO VOU WANT TO CONTINUE ?VES 



VOU: D-7 COMPUTER: S-9 

COMPUTER WINS. VOU HAVE 12 i COMPUTER HAS 11 



VOU: S-10 COMPUTER: D-9 

VOU WIN. VOU HAVE 4 ; COMPUTER HAS 1 

DO VOU WANT TO CONTINUE ?VES 



VOU HAVE RUN OUT OF CARDS. FINAL SCORE: VOU— 12 .; COMPUTER— 11 
THANKS FOR PLflVING. IT WAS FUN. 



231 



WAR 2 



TROOP TACTICS IN WAR 



Description 

In this game, you are fighting a small-scale war with the 
computer. You have 72 # 000 troops which you first must 
distribute into your Army, Navy, and Air Force. You may 
distribute them in any way you choose as long as you don't 
use more than 72,000. 

You then attach your opponent (the computer) and input 
which service and the number of men you wish to use. The 
computer then tells you the outcome of the battle, gives 
you the current statistics and allows you to determine 
your next move. 

After the second battle, it is decided from the total 
statistics whether you win or lose or if a treaty is signed. 

Program Author 

Bob Dores 

70 Summer Street 

Milton, MA. 02186 - 





1 967 by Creative Publications 



232 



13 

14 

15 

16 

17 

18 

19 

20 

21 

22 

23 

100 

105 

110 

115 

120 

125 

130 

150 

155 

160 

165 

200 

210 

215 

220 

230 

232 

235 

250 

255 

260 

270 

275 

280 

285 

290 

293 

300 

310 

320 

330 

350 

355 

360 

370 

375 

377 

378 

379 

380 

381 

385 

387 

390 

500 

501 

510 

520 

530 

1000 

1010 

1020 

1030 

1040 

1045 

1050 

1600 

1610 

1615 

1616 

1617 

1630 

1635 

1640 

1700 

1710 

1720 

1750 

1751 

1.755 

1760 

1765 

1770 

1771 

1775 

1.780 

1790 

1800 

1810 

1820 

1830 

1831 

1835 

1.837 

1840 

1845 

1850 

1851 

1860 

2000 

2001 

2002 

2005 

2006 

2007 

2008 

2010 

2012 

201.5 

2016 

2020 



PROGRAM LISTING 

1 REM BOB DO RES/ WAR 

2 PRI "I AM AT WAR WITH YOU." 

4 PRI "WE HAVE 72000 SOLDIERS A PIECE." 

5 PRI "DISTRIBUTE YOUR FORCES." 

6 PRI , "ME", "YOU" 

7 PRI"ARMY", "30000", 

8 INPUT A 

9 PRI "NAVY", "20000", 

10 INPUT B 

11 PRI"A.F.", "22000", 

12 INPUT C 
IF A+B+C>72000 THE 5 
D=30000 
E=20000 
F=22000 

PRI "YOU ATTACK FIRST. TYPE 1 FOR ARMY 2 FOR NAVY" 
PRI "AND 3 FOR AIR FORCE." 
INPUT Y 

PRI "HOW MANY MEN" 
INPUT X 

IF X<0 THEN 20 
ON Y GOTO 100,200,300 n 
IF X>A THEN 20 
IF X<A/3 THEN 120 
IF X<2*A/3 THEN 150 
GOT 270 

PRI "YOU LOST "X" MEN FROM YOUR ARMY." 
A=INT(A-X) 
GOTO 500 

PRI"YOU LOST "INTCX/3)" MEN, BUT I LOST "INTC2*D/3> 
A=INT(A-X/3) 
D=0 

GOTO 500 
IF X>B THE 20 
IF X<E/3 THEN 230 
IF X<2*E/3 THEN 250 
GOT 270 

PRI "YOUR ATTACK WAS STOPPED!" 
B=INT<B-X) 
GOTO 500 

PRI "YOU DESTROYED "INT<2*E/3>" OF MY ARMY." 
E=INT<E/3> 
GOTO 500 

PRI"YOU SUNK 1 OF MY PATROL BOATS, BUT I WIPED OUT 2" 
PRI "OF YOUR A.F. BASES, AND 3 ARMY BASES." 
A=INTCA/3> 
C=INT(C/3) 
E=INT(2*E/3) 
GOTO 500 
IFX>C THEN 20 
IF X<C/3 THEN 350 
IF X<2*C/3 THEN 370 
GOT 380 

PRI "YOUR ATTACK WAS WIPED OUT." 
C=INTCC-X> 
GOTO 500 

PRI "WE HAD A DOGFIGHT- YOU WON - AND FINISHED YOUR MISSION. 
D=INTC2*D/3> 
E=INTCE/3) 
F=INT(F/3) 
GOT500 

PRI "YOU WIPED OUT ONE OF MY ARMY PATROLS, BUT I" 
PRI "DESTROYED 2 NAVY BASES, AND BOMBED 3 ARMY BASES." 
A=INTCA/4) 
B=INTCB/3) 
D=INTC2*D/3) 
PRI 

PRI, "YOU", "ME" 
PR I "ARMY", A, D 
PRI "NAVY", B,E 
PRI"A.F.", C,F 

PRI "WHAT IS YOUR NEXT MOVE?" 
PRI "ARMY=1 NAVY=2 AIR F0RCE=3" 
INPUT G 



PRI "HOW MANY MEN" 

INPUT T 

IF T<0 THE 1030 

ON G GOTO 1600,1700,1800 

IF T>A THE 1030 

IF T<p/2 THE 1630 

PRI"YOU DESTROYED MY ARMY!" 

D=0 

GOTO 2000 

PRI "I WIPED OUT YOUR ATTACK" 

A=A-T 

GOTO 2000 

IF T>B THEN 1030 

IF T<E/2 THEN 1750 

GOT 1770 

PRI "I SUNK 2 OF YOUR BATTLESHIPS, AND MY. AIR FORCE" 

PRI "WIPED OUT YOUR UNGUARDED CAPITOL." 

A=A/4 

B=B/2 

GOTO 2000 

PRI "YOUR NAVY SHOT DOWN 3 OF MY XIII PLANES ," 

PR I "AND SUNK 3 BATTLESHIPS." 

F=2*F/3 

E=*<E/2> 

GOTO2000 

IF T>C THEN 1030 

IF T>F/2 THEN 1830 

GOT 1850 

PRI "MY NAVY AND AIR FORCE IN A COMBINED ATTACK LEFT" 

PRI "YOUR COUNTRY IN SHAMBLES." 

A=A/3 

B=B/3 

C=C/3 

GOTO 2000 

PRI "ONE OF YOUR PLANES CRASHED INTO MY HOUSE. I AM DEAD. 

PRI "MY COUNTRY FELL APART." 

GOTO 2010 

PRI 

PRI "FROM THE RESULTS OF BOTH OF YOUR ATTACKS," 

IF A+B+C>3/2*<D+E+F) THE 2010 

IF A+B+C<2/3*(D+E+F) THE 2015 

PRI "THE TREATY OF PARIS CONCLUDED THAT WE TAKE OUR" 

PRT'RESPECTIVE COUNTRIES, AND LIVE IN PEACE." 

GOT2020 

PRI "YOU WON, OH! SHUCKS!!!!!" 

GOTO 2020 

PRI "YOU LOST- I CONQUERED YOUR COUNTRY. IT SERVES YOU " 

PRI "RIGHT FOR PLAYING THIS STUPID GAME!!!" 

END 



SAMPLE RUN 

I AM AT WAR WITH YOU. 

WE HAVE 72000 SOLDIERS A PIECE. 

DISTRIBUTE YOUR FORCES. 

ME YOU 

ARMY 30000 ? 30000 

NAVY 20000 ? 20000 

A.F. 22000 ? 22000 

YOU ATTACK FIRST. TYPE 1 FOR ARMY 2 FOR NAVY 
AND 3 FOR AIR FORCE. 
? 1 

HOW MANY MEN 
? 2 
YOU LOST 2 MEN FROM YOUR ARMY. 



ME 
30000 
20000 
22000 



YOU 
ARMY 29998 

NAVY 20000 

A.F. 22000 

WHAT IS YOUR NEXT MOVE? 
ARMY=1 NAVY=2 AIR F0RCE=3 
? 1 

HOW MANY MEN 
? 2.34 
I WIPED OUT YOUR ATTACK 



FROM THE RESULTS OF BOTH OF YOUR ATTACKS, 

THE TREATY OF PARIS CONCLUDED THAT WE TAKE OUR 

RESPECTIVE COUNTRIES, AND LIVE IN PEACE. 



RUN 

I AM AT WAR WITH YOU. 



WE HAVE 72000 SOLDIERS A 


PIECE. 




DISTRIBUTE 


YOUR FORCES. 








ME 


YOU 




ARMY 


30000 


? 72000 




NAVY 


20000 


? 300000 




A.F. 


22000 


? 34 




DISTRIBUTE 


YOUR FORCES. 








ME 


YOU 




ARMY 


30000 


? 2333 




NAVY 


20000 


? 54322 




A.F. 


22000 


? 74633 




DISTRIBUTE 


YOUR FORCES. 








ME 


YOU 




ARMY 


30000 


? 3455 




NAVY 


20000 


? 6344 




A.F. 


22000 


? 27700 




YOU ATTACK 


FIRST. TYPE 1 


FOR ARMY 2 FOR 


NAVY 


AND 3 FOR t- 
? 2 

HOW MANY ME 


VIR FORCE. 






,N 






? 17899 








HOW MANY MEN 






? 3000 








YOUR ATTACK 


WAS STOPPED! 








YOU 


ME 




ARMY 


3455 


30000 




NAVY 


3344 


20000 




A.F. 


27700 


22000 





WHAT IS YOUR NEXT MOVE? 

ARMY=1 NAVY=2 AIR F0RCE=3 

? 2 

HOW MANY MEN 

? 3344 

I SUNK 2 OF YOUR BATTLESHIPS, AND MY AIR FORCE 

WIPED OUT YOUR UNGUARDED CAPITOL. 

FROM THE RESULTS OF BOTH OF YOUR ATTACKS, 

YOU LOST- I CONQUERED YOUR COUNTRY. IT SERVES YOU 

RIGHT FOR PLAYING THIS STUPID GAME!!! 

READY 

RUN 

I AM AT WAR WITH YOU. 

WE HAVE 72000 SOLDIERS A PIECE. 

DISTRIBUTE YOUR FORCES. 

ME 
ARMY 30000 

NAVY 20000 

A.F. 22000 

YOU ATTACK FIRST. TYPE 1 FOR ARMY 
AND 3 FOR AIR FORCE. 
? 3 

HOW MANY MEN 
? 6443 

YOU WIPED OUT ONE OF MY ARMY PATROLS, BUT I 
DESTROYED 2 NAVY BASES, AND BOMBED 3 ARMY BASES. 



YOU ME 

ARMY 500 20000 

NAVY 10000 20000 

A.F. 6444 22000 

WHAT IS YOUR NEXT MOVE? 
ARMY=1 NAVY=2 AIR F0RCE=3 
? 3 

HOW MANY MEN 
? 5 

ONE OF YOUR PLANES CRASHED INTO MY HOUSE. 
MY COUNTRY FELL APART. 
YOU WON, OH! SHUCKS!!!!! 

READY 



YOU 
? 2000 
? 30000 
? 6444 



FOR NAVY 



I AM DEAD. 



233 



WEKDAY 



FACTS ABOUT YOUR BIRTHDAY 



Description 



This program gives facts about your date of birth (or some 
other day of interest) . It is not prepared to give informa- 
tion on people born before the use of the current type of 
calendar, i.e. year 1582. 

You merely enter today's date in the form - month, day, 
year and your date of birth in the same form. The computer 
then tells you the day of the week of your birth date, your 
age, and how much time you have spent sleeping, eating, 
working, and relaxing. 

Source 

WEKDAY was adapted from the GE timesharing program by: 

Tom Kloos 

Oregon Museum of Science and Industry 

Portland, Oregon 97200 




234 



PROGRAM LISTING 

10 PRINT"" 

120PRINT 

124 LET Yl ■ 1970 

130 PRINT" ENTgR TOqAY'S dATe IN THIS pORMi MONTHLY, YeAR"! 

140 INPUT Hl f Dl#Yl 

150 IF Yi>100 THEN 170 

160 LET Yl * Yl + 1900 

170 DEF FNACA)«INTCA/4) 

180 DIM T(12) 

190 DEF FNB(A)«IN|(A/7) 

210 FOR !■ 1 TO 12 

220 READ T(I) 

230 NEXT I 

240 PRINT 

24tPRINT»THIS PROGRAM DEMONSTRATES PDP-11 BASIC AND ALSO GIVES » 

242PRINT"FACTS ABOUT A DATE OF INTEREST TO YOU" 

244 PRINT 

245 PRINjmENtER DATE OF BIRtH IN THIS FORM* MO, DAY, YEAR" J 
250 INPUT M,D,Y 

260 PRINT 

270 IF Y - 75 >0 THEN 280 

275 LET Y ■ Y+1900 

280 LET II * INT((Y-1500)/100) 

290 IF Y-1582<0 THEN 1300 

300 LET A « Ii*5+(Il*3)/4 

310LET 12 ■ INT(A-FNB(A)*7) 

320 LET Y.2" INTCY/100) 

330 LET Y3 » INT ( Y-Y2* 100) 

340 LET A ■ Y3/4*Y3+D+T(M)*I2 

350 LET B ■ INT(A-FNB(A)*7)+1 

360 IF M>2 THEN 470 

370 IF Y3« THEN 440 

380 LET Ti « InT(Y-FnA(Y)*4) 

390 IF Tt<> THEN 470 

400 IF B<>0 THEN 420 

410 LET B m 6 

420 LET B ■ &M 

430 GOTO 470 

440 LET A ■ 1 1-1 

450 LET Tl « INT(A-FNA(A)*4) 

460 IF Tl ■ pi THEN 400 

470 IF B <> jHEN 490 

480 LET B ■ 7 

490 IF (Yl*l2*Ml)*3l+DK(Y*12 + M)*3l*0 THEn 550 

500 iF (Y1*12*M1)*31*D1»(Y*12*M)*31*D T H EN 530 

510 PRINT Mf«/"fD>»/«;Y>" WAS * " » 

520 GOTO 570 

530 PRINT M|«/"|D|"/ , »|Yf« IS A "| 

540 GOTO 570 

550 PRINT M?V"jD|«/">Y>" WILi BE A "I 

570 IF B<>1 THEN 590 

580 PRINT "SUNDAY" 

590 IF B<>2 THEN 610 

600 PRINT "MONDAY" 

610 IF B<>3 THEN630 

620 PRINT "TUESDAY" 

630 IF B<>4 THEN 650 

640 PRINT "WEDNESDAY" 

650 IF B<>5 THEN 670 

660 PRINT "THURSDAY" 

670 IF B<>6 THEN 690 

680 GOTO 1250 

690 IF B<>7 THEN 710 

700 PRINT "SATURDAY" 

710 IF (Yl*i2+Ml)*31+Dl»CY*12+M)*3l*0 THEN 1120 

720 LET I5.Y1-Y 

730 PRINT 

740 LET I6«M1-M 

750 LET I7«Di-D 

760 IF I7>»0 THEN 790 

m LET I6«I6-1 

780 LET I7-I7+30 

790 IF I6>«0 THEN 820 

800 LET I5-I5-1 

810 LET I6.I6+12 

820 IF I5<0 THEN 1310 

830 IF I7<>0 THEN 850 

835 IF I6<>0 THEN 850 

840 PRINT "****HAPPY BIRTHDAY*****" 

850 PRINT " ","", "YEARS", "MONTHS", "DAYS" 

860 PRINT "YOUR AGE «, 15, 16, 17 

870 LET A8» ( 15*365)+ ( 16*30) +I7+INT ( 16/2) 

880 LET K5«I5 

890 LET K6«I6 

900 LET K7*I7 

920 LET E»Y+65 

940 LET F..35 

950 PRINT "YOU HAVE SLEPT «, 

960 GOSUB 1370 

970 LET F-,17 

980 PRINT "YOU HAVE EATEN «, 

990 GOSUB 1370 

1000 LET -F",23 

1010 IF k5 > 3 THEN 1040 

1020 PRlNT»YOU HAVE PLAYED «, 

1030 GOTO 1080 

1040 IF K6 > 9 THEN 1070 

1050 PRINT "YOU HAVE PLAYED/STUDIED" » 

1060 GOTO 1080 

1070 PRINT "yO U HAyE wORKED/stuDIED", 

1080 GOSUB 1370 

1090 PRINT "YOU HAVE RELAXED «,K5,K6,K7 

1100 PRINT" 

1110 PRINT « ","**YOU MAY RETjRE IN")E|«**« 

1120 PRINT 

U30 PRINT" CALCULATED BY THE BEST MINICOMPUTER TODAY - THE PDP-11" 

1140 FOR Q«i TO 2 

1150 PRINT 

1160 NEXT 

1170 PRINT 

1240 GOTO 240 

1250 IF DM3 THEN 1280 

1260 PRINT "FRIqAY " 



1270 GOTO 710 

1280 PRINT "FRIDAY THE THIRTEENTH— .BEWARE J « 

1290 GOTO 710 

1300 PRINT "NOT PREPARED TO GIVE DAY OF WEEK PRIOR TO MDLXPXII •" 

1305 PRINT " THE CURRENT CALENDAR DID NOT EXIST BEFORE THAT YEAR 

1310 GOTO 1140 

1330 DAyA 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 

1370 LET Kt» INTCF*A8) 

1380 LET 15 ■ INT(Kl/365) 

1390 LET Kl m K1-CI5*365) 

1400 LET 16 . INTCK1/30) 

1410 LET 17 ■ Kl-(Ie*30) 

1420 LET K5 ■ K5-I5 

1430 LET K6 « K6-I6 

1440 LET K7 ■ K7-I7 

1450 IF K7 >■ THEN 1480 

1460 LET K7 • K7+30 

1470 U ET K6 ■ K6-1 

1480 IF K6 > THEN 1510 

1490 LET K6 » K6+12 

1500 LET K5 s K5-1 

1510 PRINT I5f I6»I7 

1520 RETURN 

1530 IF K6 ■ 12 THEN" 1550 

1540 GOTO 1090 

1550 LET K5 « K5+1 

1560 LET K6»0 

1570 GOTO 1090 

1580 END 



SAMPLE RUN 

ENTER' TGDAV'S DATE IN THIS FORM: MONTH, DAV, VEAR? 646,12,73 

THIS PROGRAM DEMONSTRATES PDP-11 BASIC AND ALSO GIVES 
FACTS'C 



RUN 

WEKDAV 02:1€ PM 



12-JUN-73 



ENTER TODAY'S DATE IN THIS FORM: MONTH, DAV, VEAR? 6,12,73 

THIS PROGRAM DEMONSTRATES PDP-11 BASIC AND ALSO GIVES 
FACTS ABOUT A DATE OF INTEREST TO VOU 

ENTER DATE OF BIRTH IN THIS FORM: MO, DAV, VEAR? 5,17,39 

5 / 17 / 1925 WAS A WEDNESDAV 



VOUR AGE 

VOU HAVE SLEPT 

VOU HAVE EATEN 

VOU HAVE WORKED/STUDIED 

VOU HAVE RELAXED 



VEARS 
24 
11 
5 



MONTHS 
O 

11 
9 

10 
5 



DAVS 
25 

18 

5 

25 



**VOU MAV RETIRE IN 2004 ** 
CALCULATED BV THE BEST MINICOMPUTER TODAV 



THE PDP-11 



THIS PROGRAM DEMONSTRATES PDP-11 BASIC AND ALSO GIVES 
FACTS ABOUT A DATE OF INTEREST TO VOU 



ENTER DATE OF BIRTH IN THIS FORM: MO, DAV, VEAR? 9,24,48 
9 / 24 / 1948 WAS A FRIDAV 





VEARS 


VOUR AGE 


24 


VOU HAVE SLEPT 


&• 


VOU HAVE EATEN 


4 


VOU HAVE WORKED/STUDIED 


5 


VOU HAVE RELAXED 


6 



MONTHS 
8 



DAVS 
18 



13 
19 



**VOU MAV RETIRE IN 2613 ** 
CALCULATED BY THE BEST MINICOMPUTER TODAV 



THE PDP-11 



235 



WORD 



WORD GUESSING GAME 



Description 



WORD is similar to Hangman in that the player must guess 
a word with clues as to letter position furnished by the 
computer. However, instead of guessing one letter at a time, 
in WORD, you guess an entire word (or group of 5 letters, 
such as ABCDE) . The computer will tell you if any letters 
in your word are in the mystery word and if any of them are 
in the correct position. Armed with these clues, you go on 
guessing until you get the word or, if you can't get it, 
input a n ?" and the computer will tell you the mystery word. 

You may change the words in Data Statements 512 and 513, but 
they must be 5-letter words. 

Program Author 

Charles Reid 
Lexington High School 
Lexington, MA. 02173 




236 



PROGRAM LISTING 



2 PR I NT .-PRINT: PR I NT .-PRINT "PROGRAM 'WORD'" 

3 REM *** WRITTEN BV CHRIS REID, LEXINGTON HS, CLASS OF '73 
5 DIM S<7>, fi<?>,L-::?>,iX7>,P<:7> 

10 PR I NT .PR I NT "I AM THINKING OF A WORD ~ VOU GUESS IT. I WILL GIVE VOU" 

15 PRINT "CLUES TO HELP VOU GET IT. GOOD LUCK !!": PRINT : PRINT 

28 RANDOMIZE 

30 PRINT:PRINT:PRINT "VOU ARE STARTING A NEW GAME... " 

35 RESTORE 

40 READ N 

50 C=INT<RND*N+1> 

60 FOR 1=1 TO C 

70 READ S* 

S0 NEXT I 

90 G=0 

100 CHANGE S* TO S 

110 FOR 1=1 TO 5 

120 AC I > =45 

130 NEXT I 

140 FOR J=l TO 5 

144 P<J>=0 

146 NEXT J 

150 PRINT "GUESS A FIVE-LETTER WORD"; 

160 INPUT L* 

170 G=G+1 , 

172 IF L*=S* THEN 580 

180 CHANGE L* TO L 

190 IF L<1!5=63 THEN 380 

200 IF L<0><>5 THEN 480 

205 M=0 : Q=l 

218 FOR 1=1 TO 5 

228 FOR J=l TO 5 

238 IF S(I)OL(J) THEN 268 

231 P<Q>=L<J> 

232 G=Q+i 

233 IF IOJ THEN 258 
248 A<J>=L<J> 

250 M=M+1 



268 


NEXT J 




265 


NEXT I 




270 


fl<0>=5 




272 


P<0>=M 




275 


CHANGE 


A TO f\$ 


277 


CHANGE 


P TO P* 


2S0 


PRINT 


'THERE WERE 


285 


PRINT 


'FROM THE E 



'M"MATCHES AND THE COMMON LETTERS WERE. . . ", P* 
<ACT LETTER MATCHES, VOU KNOW ",fl* 

286 IF A*=S$ THEN 588 

287 IF M>1 THEN 289 

288 PRINT.PRINT "IF VOU GIVE UP, TVPE ' ?' FOR VOUR NEXT GUESS" 

289 PRINT 
298 GOTO 158 

300 CHANGE S TO S$ 

310 PRINT "THE SECRET WORD IS "S*: PRINT 

320 GOTO 38 

408 PRINT.PRINT "VOU MUST GUESS A 5-LETTER WORD. START AGAIN" 

410 PRINT :G=G-1: GOTO 158 

580 PRINT "VOU HAVE GUESSED THE WORD. IT TOOK"G"GUESSES !": PRINT 

518 INPUT "WANT TO PLAV AGAIN"; G* 

520 IF Q*="VES" THEN 38 

538 DATA 12, "DINKV", "SMOKE", "WATER", "GRASS", "TRAIN", "MIGHT", "FIRST" 

548 DATA "CANDV", "CHAMP", "WOULD", "CLUMP", "DOPEV" 

999 END 

READV 



SAMPLE RUN 

PROGRAM "WORD" 



L AM THINKING OF A WORD - 
CLUES TO HELP VOU GET IT. 



VOU GUESS IT. 
GOOD LUCK! ! 



I WILL GIVE VOU 



VOU ARE STARTING A NEW GAME. . . 

GUESS A FIVE-LETTER WORD? ABODE 

THERE WERE 1 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 



IF VOU GIVE UP, TVPE ' ?' FOR VOUR NEXT GUESS 

GUESS A FIVE-LETTER WORD? CFGHI 

THERE WERE 1 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 



IF VOU GIVE UP, TVPE ' ?' FOR VOUR NEXT GUESS 

GUESS A FIVE-LETTER WORD? CJKLMN 

VOU MUST GUESS A 5-LETTER WORD. START AGAIN 

GUESS A FIVE-LETTER WORD? CJKLM 

THERE WERE 3 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 

GUESS A FIVE-LETTER WORD? COLMN 

THERE WERE 3 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 

GUESS A FIVE-LETTER WORD? COLMP 

THERE WERE 4 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 

GUESS A FIVE-LETTER WORD? CLUMP 

VOU HAVE GUESSED THE WORD. IT TOOK 6 GUESSES! 

WANT TO PLAV AGAIN? VES 



VOU ARE STARTING A NEW GAME. . . 

GUESS A FIVE-LETTER WORD? ABCDE 

THERE WERE 8 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 



CLM 

C— — 



CLM 
C--M- 



CLMP 
C--MP 



IF VOU GIVE UP, TVPE 



FOR VOUR NEXT GUESS 



GUESS A FIVE-LETTER WORD? FGHIJ 

THERE WERE 2 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 

GUESS A FIVE-LETTER WORD? FIKLM 

THERE WERE 2 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW. 

GUESS A FIVE-LETTER WORD? FT NOP 

THERE WERE 2 MATCHES AND THE COMMON LETTERS WERE. 

FROM THE EXACT LETTER MATCHES, VOU KNOW 

GUESS A FIVE-LETTER WORD? FIRST 

VOU HAVE GUESSED THE WORD. IT TOOK 5 GUESSES! 

WANT TO PLAV AGAIN? NO 



FI 
F— 



FI 

FI 



FI 
FI- 



237 



YAHTZE 



DICE GAME OF YAHTZEE 



Description 

Yahtzee may be played by up to 15 people. The object of the 
game is to get the highest grand total score. Each player 
on his turn receives from the computer the values of 5 
pseudo dice. He may then roll as many of them as he wants 
to again. This may be repeated once again (3 rolls maximum), 
To roll again, you tell the computer how many dice you want 
to re-roll or change and the number of each die. You play 
13 rounds for a complete game. 

After you have finished rolling, you must decide how you 
want to score the five dice. Typing "SUMMARY" will show 
you which categories have been used, otherwise, you must 
decide on one of 13 categories or "ZERO" to eliminate a 
category with no score. 



Category 



How Scored 



ACES 

TWOS 

THREES 

FOURS 

FIVES 

SIXES 

THREE OF A KIND 

FOUR OF A KIND 

FULL HOUSE 

SMALL STRAIGHT 

LARGE STRAIGHT 

YAHTZEE 

CHANCE 

ZERO 



Count and add all ones. 
Count and add all twos. 
Count and add all threes. 
Count and add all fours. 
Count and add all fives. 
Count and add all sixes. 
Total all 5 dice (assuming 3 
Total all 5 dice (assuming 4 
25 Points (3 of one kind, 
30 Points (Sequence of 4) . 
40 Points (Sequence of 5) . 
50 Points (5 of a kind) . 
Total of all 5 dice. 
Zero out any category above 



of 
of 



kind) 
kind) 



2 of another) 



If your accumulated score of the first six categories ever reaches 
63 points, you receive a bonus of 35 points. 

Source 

Unfortunately, the program author of this extremely comprehensive 
game is unknown. 



238 



PROGRAM LISTING 

1000 A(0)-5 

1010 FOR U»l TO 5 

1020 A(U)a7 

1030 NEXT U 

1040 CHANGE A TO CS 

1060DIMACl5,15),TCt5,15),FC15,15),SC15,l5),LCi5,i5),KCl5,l5),HCl5,15) 

1070 FOR I«l TO 5 

1080 B(I)a0 

1090 OCD-0 

1100 A(I)«0 

1110 NEXT I 

1120 RANDOM 

1130 PRINT "HOW MANY PLAYERS tTJfPEl <0« FOP INSTRUCTIONS] » I 

U40 INPUT P 

1150 IF P>15 THEN 1180 

1160 IF P«0 THEN 4980 

1170 GO TO 1200 

1180 GOSUB 5710 

1190 GO TO 1130 

1200 IF Ps.01 THEN 1220 

1210 GO TO 1240 

1220 GOSUB 5730 

1230 GO TO 1140 

1240 FOR I«l TO P 

1250 A(l,I)s-5 

1260 T(l,I)«-5 

1270 TC2,I)=-5 

1280 FCl»I)s-b 

1290 F(2,I)s-5 

1300 S(l#I)»-5 

1310 TC3,I)**5 

1320 F(3,I)"-5 

1330 F(4,I)»-5 

1340 S(2,I)a-5 

1350 LCl#I)»-5 

1360 YCI)b-5 

1370 C(l)*»»5 

1380 K(1#I)»0 

1390 K(I)»0 

1400 M(I)*0 

1410 PRINT "NAME"* 

1420 INPUT N$CI) 

1430 IF N$CI)a»WHAT?» THEN 1450 

1440 GO TO 1470 

1450 GOSUB 5580 

1460 GO TO 1410 , 

1470 NEXT I 

1480 Rs0 

1490 RaR+1 

1495 IF R>13 THEN 6470 

1500 PRINT 

1510 PRINT 

1520 PRINT "ROUND" »R 

15 30 PRINT 

1540 FOR 1=1 TO P 

1550 PRINT 

1560 PRINT 

1570 PRINT N$(I)|i"S TURN" 

1580 FOR L«l TO 5 

1590 ACL)=INTC6#RNDC-1)+1) 

1600 NEXT L 

1605 GOSUB 1610 

1607 GO TO 1700 

1610 Go0 

1620 FOR X»l TO 5 

1630 IF A(X)>=ACX+1) THEN 1680 

1640 HoACX) 

1650 A(X)s»ACX+l) 

1660 A(X+1)'«H 

1670 G=l 

1680 NEXT X 

1685 IF G«l THEN 1610 

1690 RETURN 

1700 PRINT "YOU HAVE A » >AC 1 ) f A(2 ) I AC3) » AC4) » A(5) 

1710 PRINT "THIS IS YOUR 2ND OF 3 ROLLS," 

1720 PRINT "HOW MANY DO YOU WANT TO CHANGE"? 

1730 INPUT Z 

1740 IF Z=.01 THEN 1760 

1750 GO TO 1780 

1760 GOSUB 5600 

1770 GO TO 1730 

1780 IF Z*0 THEN 2620 

1790 IF Z»5 THEN 1890 

1800 FOR Sal TO Z 

1810 PRINT "WHICH"! 

1820 INPUT BCS) 

1830 IF B(S)«,01 THEN 1850 

1840 GO TO 1870 

1850 GOSUB 5620 

1860 GO TO 1810 

1870 NEXT S 

1880 GO TO 1930 

1890 FOR S»l TO 5 

1900 A^S)aINTC6#RND(-i)+l) 

1910 NEXT S 

1920 GO TO 2050 

1930 FOR Lai TO S 

1940 FOR Llal TO 5 

1950 IF BCDaLl THEN 1970 

1960 GO TO 1980 

1970 A(LI)bQCLI) 

1980 NEXT LI 

1990 NEXT L 

2000 FOR Sal TO 5 

2010 IF A(S)a0 THEN 2030 

2020 GO TO 2040 

2030 A(S)aINTC6#RNDC«l)+l) 

2040 NEXT S 

2050 GOSUB 1610 

2140 PRINT "YOU HAVE A « f ACl ) > AC2) t ACS ) > A(4) ) A(5) 

2150 PRINT "THIS IS YOUR LAST ROLL#" 

2160 PRINT "HOW MANY DO YOU WANT TO CHANGE" J 

2170 INPUT Z 

2180 IF Za,01 THEN 2200 

2190 GO TO 2220 

2200 GOSUB 5600 

2210 GO TO 2170 

2220 IF Za0 THEN 2620 

2230 IF Za5 THEN 2360 

2240 FOR Eal TO 5 



239 



2250 B(E)a0 
2260 NEXT E 
2270 FOR Sal TO I 

2280 PRINT "WHICH" > 

2290 INPUT BCS) 

2300 IF B(S)a,01 THEN 2320 

2310 GO TO 2340 

2320 GOSUB 5620 

2330 GO TO 2280 

2340 NEXT S 

2350 GO TO 2400 

2360 FOR Sal TO 5 

2370 ACS)aiNTC6#RNDC«l)fl) 

2380 NEXT S 

2390 GO TO 2520 

2400 FOR Lai TO 5 

2410 FOR Ltal TO 5 

2420 IF BCLJaLl THEN 2440 

2430 GO TO 2450 

2440 A(Ll)aQCL) 

2450 NEXT LI 

2460 NEXT L 

2470 FOR S«l TO 5 

2480 IF A(S)a0 T HEN 2500 

2490 GO TO 2510 

2500 ACS)aINTC6»RND(-l)+l) 

2510 NEXT S 

2520 GOSUB 1610 

2610 PRINT "YOU HAVE A " > AC 1 ) » A (2) I AC 3) » A(4) f A(5) 

2620 PRINT "HOW DO YOU WANT THIS ROUND SCORED"! 

2630 INPUT ZS 

2640 IF Z$a"WHAT?" THEN 2680 

2650 IF ZSa»SUMMARY« THEN 2670 

2660 GO TO 2700 

2670 GOSUB 6140 

2675 GO TO 2620 

2680 GOSUB 5650 

2690 GO TO 2630 

2700 IF Z$a"ACES" THEN 2850 

2710 IF ZSa"TWOS» THEN 2940 

2720 IF Z$«3«THREE5" THEN 3030 

2730 IF Z$a"FOURS" THEN 3120 

2740 IF Z$8"FIV£S« THEN 3210 

2750 IF Z$a«siXES" THEN 3300 

2760 IF Z$a«THREE OF A KIND" THEN 3390 

2770 IF Z$aitFOUR OF A KIND" THEN 3440 

2780 IF Z$a"FULL HOUSE" THEN 3520 

2790 IF Z$="SM, STRAIGHT" THEN 3620 

2800 IF Z$a"LG, STRAIGHT" THEN 3660 

2810 IF Z$a"YAHTZEE" THEN 3730 

2820 IF Z$a"CHANCE" THEN 3820 

2830 IF ZSaf'ZERO" THEN 3890 

2840 GO TO 2620 

2850 IF A(l,I)<>-5 THEN 3870 

2860 ACl#I)a0 

2870 FOR Sal TO 5 

2880 IF ACS)al THEN 2900 

2890 GO TO 2910 

2900 A(i,I)«ACl#I)+i 

2910 NEXT S 

2920* MCI)«A<1#I) 

2930 GO TO 4690 

2940 IF T(l,I)<>-5 THEN 3870 

2950 T(l,I)a0 

2960 FOR Sal TO 5 

2970 IF ACS)a2 THEN 2990 

2980 GO TO 3000 

2990 T(i#I)«T(ifI>*2 

3000 NEXT S 

3010 MU)»T(1#I) 

3020 GO TO 4690 

3030 IF TC2,I)<>-5 THEN 3870 

3040 TC2,I)a0 

3050 FOR Sal TO 5 

3060 IF ACS)b3 THEN 3080 

3070 GO TO 3090 

3080 T(2,I)sTC2,I)+J 

3090 NEXT S 

3100 MCI)aTC2,I) 

3110 GO TO 4690 

3120 IF FCl»I)<>-5 THEN 3870 

3130 FCl,I)a0 

3140 FOR Sal TO 5 

3150 IF ACS)"4 THEN 3170 

3160 GO TO 3180 

3170 FCiiI)BFClfI)+4 

3180 NEXT S 

3185 MCI)*F(1,I) 

3190 GO TO 4690 

3210 IF FC2,I)<>-5 THEN 3870 

3220 F(2,I)80 

3230 FOR Sal TO 5 

3240 IF ACS)a§ THEN 3260 

3250 GO TO 3270 

3260 FC2,I)=FC2,I)+5 

3270 NEXT S 

3280 M(I)aFC2,I) 

3290 GO TO 4690 

3300 IF SCl,I)<>-5 THEN 3870 

3310 S(l, I)a0 

3320 FOR Sal TO 5 

3330 IF ACS)a6 THEN 3350 

3340 GO TO 3360 

3350 S(l,I)«3Cl,I)+6 

3360 NEXT S 

3370 MCI)=SC1>I) 

3380 GO TO 4690 

3390 IF TC3,I)<>-5 THEN 3870 

3400 TC3,I)a0 

3410 TC3,I)aACl)+A(2)+AC3)+AC4)+AC5) 

3420 MCI)aTC3,I) 

3430 GO TO 4690 

3440 IF FC3,I)<>-5 THEN 3870 

3450 IF AC1)<>AC4) THEN 4960 

3460 IF A(2)<>A(3) THEN 4960 

3470 FC3,I)a0 

3480 F(3,I)aA(l)+A(2)+AC3)+AC4)+AC5) 

3490 MCI)aF(3,I) 

3500 F(3,I)a0 

3510 GO TO 4690 



3520 IF FC4,I)<>«5 THEN 3870 

3530 IF AC1)<>A(2) THEN 4960 

3540 IF A(4)OA(S) THEN 4960 

3550 IF AC3)OA(2) THEN 3570 

3560 GO TO 3590 

3570 IF A(3)OA(4) THEN 4960 

3580 GO TO 3590 

3590 F(4,X)«25 

3600 MU)«FC4,X) 

3610 GO TO 4690 

3620 IF SC2,I)<>-5 THEN 3870 

3630 S(2,I)*30 

3640 M(I)»S(2,I) 

3650 GO TO 4690 

3660 IF LC1,I)<>*5 THEN 3870 

3670 IF A(l)OA(5)+4 THEN 4960 

3680 IF A(2)<>AC4)+2 THEN 4960 

3690 IF AC3)<>A(5)+2 THEN 4960 

3700 L(.l,I)s40 

3710 MCI)»L(1#I) 

3720 GO TO 4690 

3730 IF Y(I)<>-5 THEN 3870 

3740 FOR Q«l TO 5 

3750 FOR 01*1 TO 5 

3760 IF ACO)OA(Ol) THEN 4960 

3770 NEXT 01 

3780 NEXT 

3790 YCI)=50 

3800 M(I)«Y(I) 

3810 GO TO 4690 

3820 IF CCI)<>"5 THEN 3870 

38 30 C ( I ) «A C 1 > +A C 2 ) +A C 3 ) +A ( 4 ) + A ( 5 ) 

3840 

3850 MCI) B CCI) 

3860 GO TO 4690 

3870 GOSUB 4650 

3880 GO TO 2620 

3890 PRINT "WHAT DO YOU WANT TO ZERO"? 

3900 INPUT ZS 

3920 IF Z$»"SUMMARY" THEN 3940 

3930 GO TO 3970 

3940 GOSUB 6140 

3945 GO TO 2620 

3950 GOSUB 5680 

3960 GO TO 3900 

3970 IF Z$«"ACES" THEN 4110 

3980 IF Z$*"TWOS" THEN 4150 

3990 IF Z$s»THREES" THEN 4190 

4000 IF Z$»"FOURS" THEN 4230 

4010 IF Z$»"FIVES» THEN 4270 

4020 IF Z$s"SIXES" THEN 4310 

4030 IF ZS="THREE OF A KIND" THEN 4350 

4040 IF Z$=«FOUR OF A KIND" THEN 4390 

4050 IF ZS*"FULL HOUSE" THEN 4430 

4060 IF ZS""SM, STRAIGHT" THEN 4470 

4070 IF ZSs"LG, STRAIGHT" THEN 4510 

4080 IF Z$a»YAHTZEE» THEN 4550 

4090 IF Z$s"CHANCE" THEN 4590 

4100 GO TO 3890 

4110 IF A(l,I)<>-5 THEN 4630 

4120 AU*I) = 

4130 M(I)»ACi,I) 

4140 GO TO 4690 

4150 IF T(1,I)<>»5 THEN 4630 

4160 TC1#I)«0 

4170 M(I)=T(1,I) 

4180 GO TO 4690 

4190 IF T(2,I)<>-5 THEN 4630 

4200 T(2,I)«0 

4210 MCI)«TC2,I) 

4220 GO TO 4690 

4230 IF F(1,I)<>.5 THEN 4630 

4240 . FC1,I)«0 

4250 MCI)»FU,I) 

4260 GO TO 4690 

4270 IF F(2»I)<>-5 THEN 4630 

4280 FC2»I)*0 

4290 M(I)*F(2,I) 

4300 GO TO 4690 

4310 IF S(l,I)<>-5 THEN 4630 

4320 S(l,I)a0 

4330 MU)«S(1,I) 

4340 GO TO 4690 

4350 IF T(3,I)<>«5 THEN 4630 

4360 T(3#I)»0 

4370 M(I)»T(3,I) 

4380 GO TO 4690 

4390 IF FC3,I)<>«b THEN 4b30 

4400 F(3,I)»0 

4410 M.(I)aF(3,I) 

4420 GO TO 4690 

4430 IF F(4,I)<>-5 THEN 4630 

4440 F(4,I)»0 

4450 M(I)sF(4,I) 

4460 GO TO 4690 

4470 IF S(2,I)<>-5 THEN 4630 

4480 S(2»I)a0 

4490 MCI)»S(2#I) 

4500 GO TO 4690 

4510 IF LCl,I)<>»5 THEN 4630 

4520 L(l, I)a0 

4530 MCI)»L(1#I) 

4540 GO TO 4690 

4550 IF Y(I)<>«5 THEN 4630 

4560 YCI)«0 

4570 MCI)aY(I) 

4580 GO TO 4690 

4590 IF C(I)<>-5 THEN 4630 

4600 CCI)*0 

4610 MCI)«C(I) 

4620 GO TO 4690 

4630 GOSUB 4650 

4640 GOTO 2620 

4650 PRINT "YOU HAVE ALREADY USED »>Z$»" AS A CATEGORY"»C$ 

4660 PRINT 

4670 RETURN 

4680 GOTO 2620 

4690 PRINT N$(I)>" YOU GET A SCORE OF "»MCI)»" FOR THIS ROUND" 

4700 GO TO 5750 

4710 NEXT I 



240 



4720 PRINT 

4730 FOR J»l TO P 

4740 IF M(J)*A(1,J) THEN 4810 

4750 IF M(J)»TC1,J) THEN 4810 

4760 IF M(J)*TC2,J) THEN 4810 

4770 IF M(J)«FClid) THEN 4810 

4780 IF MCJ)»FC2,J) THEN 4810 

4790 IF M(J)«S(i,J) THEN 4810 

4800 GO TO 4920 

4810 KC1,J)«K(1,J)+MCJ) 

4820 GO TO 4830 

4830 IF K(i,J)>*63 THEN 4860 

4840 KCJ)*K(J)+MCJ) 

4850 GO TO 4930 

4860 KCi,J)»KCl,J3+35 

4870 PRINT CS?N$(J)>" HAS ACCUMULATED AT LEAST 63 POINTS" 

4880 PRINT "IN THE FIRST SIX CATEGORIES," 

4890 PRINT "HE SCORES A BONUS OF 35 POINTS! »>C$ 

4900 K(d)«KCJ)+M(J) 

4910 GO TO 4930 

4920 KCJ)»K(J)+M(J) 

4930 PRINT N$CJ)!" HAS »|K(J)>" POINTS" 

4940 NEXT J 

4950 GO TO 1490 

4960 PRINT "IT IS ILLEGAL TO USE ">ZSp« THIS ROUND" |C$ 

4970 GO TO 2620 

4980 PRINT 

4990 PRINT 

5000 PRINT 

5010 PRINT "INSTRUCTIONS FOR PLAYING YAHTZEE" jC$ 

5020 PRINT 

5030 PRINT "YAHTZEE MAY BE PLAYED BY UP TO 15 PEOPLE," 

5040 PRINT "THE OBJECT OF THE GAME IS TO GET THE HIGHEST SCORE" 

5050 PRINT "EACH PLAYER ON HIS TURN RECEIVES FROM THE COMPUTER" 

5060 PRINT "THE VALUES OF THE 5 PSEUDO-DICE. HE MAY THEN ROLL" 

5070 PRINT "AS MANY OF THEM AS HE WANTS TO AGAIN, HOWEVER," 

5080 PRINT "HE IS ENTITLED UP TO BUT NO MORE THAN THREE ROLLS" 

5090 PRINT "OF THE DICE," 

5100 PRINT " YOU TELL THE COMPUTER MANY DICE YOU" 

5110 PRINT "WANT TO CHANGE, THEN TELL IT WHICH ONES IN THE FOL-" 

5120 PRINT "LOWING MANNER* " 

5130 PRINT 

5140 PRINT " TYPE! t 1 » FOR THE 1ST DIE, «2» FOR THE 2ND, ETC" 

5150 PRINT » AFTER THE THIRD ROLL THE PLAYER MUST DECIDE HOW" 

5160 PRINT "HE WANTS TO SCORE HIS FIVE DICE," 

5170 PRINT "TYPING • SUMMARY » WILLL SHOW WHAT CATEGORIES" 

5180 PRINT "HAVE BEEN USED, OTHERWISE," 

5190 PRINT "YOU HAVE 13 CHOICES, TYPE 1 OF THE FOLLOWING" 

5200 PRINT "DEPENDING ON HOW YOU WANT YOUR DICE SCORED," 

5210 PRINT "THE CHOICES ARE J" 

5220 PRINT "ACES, TWOS, THREES, FOURS, FIVES. SIXES" 

5230 PRINT "THREE OF A KIND, FOUR OF A KIND, FULL HOUSE, SM, STRAIGHT," 

5240 PRINT "LG, STRAIGHT, YAHTZEE, CHANCE, " 

5250 PRINT "WHAT THE COMPUTER WILL DO!" 

5260 PRINT "FOR ACES IT WILL COUNT AND ADD ALL OF YOUR ONES." 

5270 PRINT "FOR TWOS IT WILL COUNT AND ADD ALL OF YOUR TWOS," 

5280 PRINT "THE SAME IS TRUE THROUGH THE SIXES" 

5290 PRINT "THREE OF A KIND WILL TOTAL ALL OF THE DICE PRO-" 

5300 PRINT "VIDED THAT YOU HAVE THREE OF A KIND" 

5310 PRINT "FOUR OF A KIND IS THE SAME AS THREE OF A KIND EXCEPT" 

5320 PRINT "THAT YOU MUST HAVE FOUR OF A KIND" 

5330 PRINT "FULL HOUSE [3 OF ONE NO, AND 2 OF ANOTHER] WILL YIELD" 

5340 PRINT "25 POINTS, SM, STRAIGHT WILL GIVE YOU 30 POINTS BUT" 

5350 PRINT "YOU MUST HAVE A SEQUENCE OF FOUR," 

5360 PRINT "LG, STRAIGHT WILL YIELD 40 POINTS BUT YOU MUST HAVE A SE-" 

5370 PRINT "OUENCE OF FIVE," 

5380 PRINT "YAHTZEE WILLL GIVE 50 POINTS IF YOU HAVE FIVE OF A KIND," 

5390 PRINT "CHANCE WILL TOTAL ALL OF YOUR DICE AND USE THAT AS YOUR SCORE," 

5400 PRINT "CHANCE IS USEFUL WHEN YOU DON'T HAVE ANYTHING WORTH SCORING," 

5410 PRINT "ANOTHER CATEGORY, • ZERO ' WILL ZERO OUT A CATEGORY" 

5420 PRINT "IF YOU DON'T HAVE ANYTHING WORTH SCOPING" 

5430 PRINT "BUT HAVE PERHAPS ALREADY USED YOUR CHANCE," 

5440 PRINT 

5450 PRINT "IF YOUR ACCUMULATED SCORE OF THE FIRST SIX CATEGORIES" 

5460 PRINT "EVER REACHES AT LEAST 63 POINTS YOU WILL RECEIVE" 

5470 PRINT "A BONUS OF 35 POINTSI"?C$ 

5480 PRINT 

5490 PRINT "FOR INSTRUCTIONS DURING THE RUNNING OF THE PROGRAM" 

5500 PRINT "TYPE 'WHAT?' WHEN THE COMPUTER ASKS FOR A WORD, OR," 

5510 PRINT" I, 01 » WHEN IT WANTS A NUMBER, AND YOU WILL RECEIVE" 

5520 PRINT "FURTHER NOTES RELATED TO WHAT THE COMPUTER ASKED FOR," 

5530 PRINT 

5540 PRINT 

5550 PRINT 

5560 PRINT "GOOD LUCKj M U « »CS 

5570 GO TO 1070 

5580 PRINT "WHAT DO YOU WANT ONE OF THE PLAYERS CALLED BY" 

5600 PRINT "HOW MANY DICE DO YOU WANT TO ROLL AGAIN"} 

5610 RETURN 

5620 PRINT "WHICH DIE DO YOU WANT TO CHANGE" 

5630 PRINT "TYPEJ '1' FOR THE 1ST DIE, '2' FOR THE 2ND DIE, ETC," 

5640 RETURN 

5650 PRINT "IN WHICH CATEGORY DO YOU WANT THIS ROUND SCORED" 

5660 PRINT "TYPINGl 'SUMMARY' WILL TELL YOU WHICH CATEGORIES YOU HAVE USED"» 

5670 RETURN 

5680 PRINT "WHICH CATEGORY DO YOU WANT ZEROED" 

5690 GO TO 5660 

5710 PRINT "A MAXIMUM OF 15 PLAYERS IS ALLOWED" 

5720 RETURN 

5730 PRINT "HOW MANY PEOPLE WISH TO PLAY"! 

5740 RETURN 

5750 IF ZS«"ACES" THEN 5880 

5760 IF Z$«"TWOS" THEN 5900 

5770 IF Z$«"THREES" THEN 5920 

5780 IF Z$»"FOURS" THEN 5940 

5790 IF Z8=»FIVES» THEN 5960 

5800 IF Z$b«sixeS" THEN 5980 

5810 IF Z$s-"THREE OF A KIND" THEN 6000 

5820 IF Z$«"FOUR OF A KIND" THEN 6020 

5830 IF Z$«»FULL HOUSE" THEN 6040 

5*40 IF Z8"»SM, STRAIGHT" THEN 6000 

5850 IF Z$»"LG, STRAIGHT" THEN 6080 

5860 IF Z8«"YAHTZEE" THEN 6100 

5870 IF Z$«"CHANCE" THEN 6120 

5880 H(I,R)«1 

5890 GO TO 4710 

5900 H(I,R)«2 

5910 GO TO 4710 

5920 H(I,R)»3 

5930 GO TO 4710 



5940 


HCI,^ 


■ 4 






5950 


GO TO 


4710 






5960 


H(I,R)a5 






5970 


GO TO 


4710 






5980 


hci,r: 


a6 






5990 


GO TO 


4710 






6000 


hci#r: 


a7 






6010 


GO TO 


4710 






6020 


H(I,RJ 


■ 8 






6030 


GO TO 


4710 






6040 


hci,r: 


■ 9 






6050 


GO TO 


4710 






6060 


HCI»RJ 


■ 10 






6070 


GO TO 


4710 






6060 


H(I,RJ 


■11 






6090 


GO TO 


4710 






6100 


H(I,R) 


■ 12 






6110 


GO TO 


4710 






6120 


H(I,R3 


■13 






6130 


GO TO 


4710 






6140 


PRINT 


N$(I)t" HAS USED 


THE FOLLOWING 


CATEGORIESI" 


6150 


FOR S= 


1 TO (R-l) 






6160 


IF HCI 


,S)>7 THEN 6180 






6170 


ON HCI 


,S) GO TO 6190,6210,6230,6250, 


6270,6290,6310 


6180 


ON HCI 


,S)«7 GO TO 6330 


,6350,6 370,6390,6410,6430 


6190 


PRINT 


"ACES, "> 






6200 


GO TO 


6440 






6210 


PRINT 


"TWOS, "> 






6220 


GO TO 


6440 






6230 


PRINT 


"THREES, «> 






6240 


GO TO 


6440 






6250 


PRINT 


"FOURS, "> 






6260 


GO TO 


6440 






6270 


PRINT 


"FIVES, »» 






6280 


GO TO 


6440 






6290 


PRINT 


"SIXES, »> 






6300 


GO TO 


6440 






6310 


PRINT 


"THREE OF A KIND 


» "l 




6320 


GO TO 


6440 






6330 


PRINT 


"FOUR OF A KIND, 


"1 




6340 


GO TO' 


6440 






6350 


PRINT 


"FULL HOUSE, "> 






6360 


GO TO 


6440 






6370 


PRINT 


"SM. STRAIGHT, » 






6380 


GO TO 


6440 






6390 


PRINT 


"LG. STRAIGHT, " 






6400 


GO TO 


6440 






6410 


PRINT 


"YAHTZEE, "| 






6420 


GO TO 


6440 






6430 


PRINT 


"CHANCE, "| 






6440 


NEXT S 








6445 


PRINT 








6446 


PRINT 


"HE HAS "»K(I)»" 


POINTS," 




6447 


PRINT 


"AND "fK(l,I)j" OF THE 65 POINTS NEEDED FOR THE BONUS"? 


6450 


PRINT 


H f « 






6460 


RETURN 


' v 






6470 


Ga0 








6480 


FOR Xb 


1 TO P 






6490 


IF SCX)>aS(X>l) THEN 6540 




6500 


HaS(X) 








6510 


S(X)«S(X+1J 






6520 


stx+n 


aH 






6530 


Gal 








6540 


NEXT X 








6550 


IF G=l 


THEN 6470 






6560 


PRINT 


"THE GAME IS OVER." 




6570 


PRINT 








6571 


FOR Xa 


1 TO P 






6572 


IF K(X)aS(X) THEN 6580 






6573 


NEXT X 








6580 


PRINT 


"THE WINNER IS "jN$Cl)>" WITH 


»|K(1)>" POINTS." 


6585 


IF Pal 


THEN 9999 






6586 


PRINT 


"OTHER FINAL SCORES AREI" 




6590 


FOR Ya 


1 TO P 






6600 


IF K(Y)bS(X) THEN 6620 






6610 


PRINT 


N$(Y)f» FINISHES 


WITH »|KC¥)>" 


POINTS." 


6620 


NEXT y 








9999 


END 









SAMPLE RUN 

HOW MANY PLAYERS C TVPE : '0' FOR INSTRUCTIONS] ?& 

INSTRUCTIONS FOR PLflVINQ YAHTZEE 

YAHTZEE MAY BE PLftVED BV UP TO 15 PEOPLE. 

THE OBJECT OF THE GAME IS TO GET THE HIGHEST SCORE 

EACH PLRVER ON HIS TURN RECEIVES FROM THE COMPUTER 

THE VALUES OF THE 5 PSEUDO-DICE. HE MAY THEN ROLL 

AS MANV OF THEM AS HE WANTS TO AGAIN. HOWEVER, 

HE IS ENTITLED UP TO BUT NO MORE THAN THREE ROLLS 

OF THE DICE. 

VOU TELL THE COMPUTER MANV DICE VOU 
WANT TO CHANGE, THEN TELL IT WHICH ONES IN THE FOL- 
LOWING MANNER: 

TVPE: 'I' - FOR THE 1ST DIE, '2' FOR THE 2ND, ETC 

AFTER THE THIRD ROLL THE PLAYER MUST DECIDE HOW 
HE WANTS TO SCORE HIS FIVE DICE. 
TYPING 'SUMMARY' WILLL SHOW WHAT CATEGORIES 
HAVE BEEN USED. OTHERWISE, 

YOU HAVE 13 CHOICES, TYPE 1 OF THE FOLLOWING 
DEPENDING ON HOW YOU WANT YOUR DICE SCORED. 
THE CHOICES ARE: 

ACES, TWOS, THREES, FOURS, FIVES, SIXES 

THREE OF A KIND, FOUR OF A KIND, FULL HOUSE, SM. STRAIGHT, 
LG. STRAIGHT, YAHTZEE, CHANCE. 
WHAT THE COMPUTER WILL DO: 

FOR ACES IT WILL COUNT AND ADD ALL OF YOUR ONES. 
FOR TWOS IT WILL COUNT AND ADD ALL OF YOUR TWOS. 
THE SAME IS TRUE THROUGH THE SIXES 
THREE OF A KIND WILL TOTAL ALL OF THE DICE PRO- 
VIDED THAT YOU HAVE THREE OF A KIND 

FOUR OF A KIND IS THE SAME AS THREE OF A KIND EXCEPT 
THAT YOU MUST HAVE FOUR OF A KIND 

FULL HOUSE C 3 OF ONE NO. AND 2 OF ANOTHER] WILL YIELD 
25 POINTS. SM. STRAIGHT WILL GIVE YOU 3:0 POINTS BUT 
YOU MUST HAVE A SEQUENCE OF FOUR. 

LG. STRAIGHT WILL YIELD 40 POINTS BUT YOU MUST HAVE A SE- 
QUENCE OF FIVE. 

YAHTZEE WILLL GIVE 59 POINTS IF YOU HAVE FIVE OF A KIND. 
CHANCE WILL TOTAL ALL OF YOUR DICE AND USE THAT AS YOUR SCORE. 
CHANCE IS USEFUL WHEN YOU DON'T HAVE ANYTHING WORTH SCORING. 
ANOTHER CATEGORY, 'ZERO' WILL ZERO OUT A CATEGORY 
IF YOU DON'T HAVE ANYTHING WORTH SCORING 
BUT HAVE PERHAPS ALREADY USED YOUR CHANCE. 

IF YOUR ACCUMULATED SCORE OF THE FIRST SIX CATEGORIES 
EVER REACHES AT LEAST 63 POINTS YOU WILL RECEIVE 
A BONUS OF 25 POINTS! 

FOR INSTRUCTIONS DURING THE RUNNING OF THE PROGRAM 
TYPE 'WHAT?' WHEN THE COMPUTER ASKS FOR A WORD, OR, 
'.01' WHEN IT WANTS A NUMBER, AND YOU WILL RECEIVE 
FURTHER NOTES RELATED TO WHAT THE COMPUTER ASKED FOR. 



GOOD LUCK ! ! ! ! ! 

HOW MANV PLAYERS [TYPE: 

NAME ?DAVE 

NAME ?KEN 



' O' FOR I NSTRUCT I ONS 3 ?2 



DflVE'S TURN 

YOU HAVE A 5 4 2 2 2 

THIS IS YOUR 2ND OF 3 ROLLS, 

HOW MANY DO YOU WANT TO CHANGE ?. 01 

HOW MANV DICE DO YOU WANT TO ROLL AGAIN ?1 

WHICH ?5 

YOU HAVE A 5 4 2 2 1 

THIS IS YOUR LAST ROLL, 

HOW MANY DO YOU WANT TO CHANGE ?0 

HOW DO YOU WANT THIS ROUND SCORED ?LG. STRAIGHT 

DAVE YOU GET A SCORE OF 40 FOR THIS ROUND 



KEN'S TURN 

YOU HAVE A 5 4 4 2 1 

THIS IS YOUR 2ND OF 3 ROLLS, 

HOW MANY DO VOU WANT TO CHANGE ?1 

WHICH ?3 

YOU HAVE A 5 4 2 2 1 

THIS IS VOUR LAST ROLL, 

HOW MANY DO YOU WANT TO CHANGE ?1 

WHICH ?3 

YOU HAVE A 5 4 2 1 1 

HOW DO VOU WANT THIS ROUND SCORED ?TWOS 

KEN VOU GET A SCORE OF 2 FOR THIS ROUND 

DAVE HAS 48 POINTS 
KEN HAS 2 POINTS 



241 



DflVE'S TURN 

YOU HAVE A S 6 4 2 1 

THIS IS YOUR 2ND OF 3 ROLLS, 

HOW MANY DO YOU WANT TO CHANGE ?3 

WHICH ?3, 4, 5 

WHICH ?4 

WHICH ?5 

YOU HAVE A 6 6 6 3 3 

THIS IS YOUR LAST ROLL, 

HOW MANY DO VOU WANT TO CHANGE ?0 

HOW DO YOU WANT THIS ROUND SCORED ?FULL HOUSE 

DAVE YOU GET A SCORE OF 25 FOR THIS ROUND 



KEN'S TURN 

VOU HAVE A 5 5 3 3 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?5 

VOU HAVE A 5 5 3 2 1 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?2 

VOU HAVE A 5 3 2 1 1 

HOW DO VOU WANT THIS ROUND SCORED ?ACES 

KEN VOU GET A SCORE OF 2 FOR THIS ROUND 

DAVE HAS 65 POINTS 
KEN HAS 4 POINTS 



KEN'S TURN 

VOU HAVE A 5 3 2 2 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?3 

VOU HAVE A 6 5 3 2 1 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?1 

VOU HAVE A 5 3 2 1 1 

HOW DO VOU WANT THIS ROUND SCORED ?SUMMARV 

KEN HAS USED THE FOLLOWING CATEGORIES: 

TWOS, ACES, SM. STRAIGHT, LG. STRAIGHT, SIXES, FIVES, 

L HOUSE, THREE OF A KIND, 

HE HAS 151 POINTS, 

AND 45 OF THE 65 POINTS NEEDED FOR THE BONUS. 

HOW DO VOU WANT THIS ROUND SCORED ?CHANCE 

KEN VOU GET A SCORE OF 12 FOR THIS ROUND 



THREES, FOURS, FUL 



DAVE'S TURN 

VOU HAVE A 6 5 4 4 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?2 

WHICH ?4 

WHICH ?5 

VOU HAVE A 6 5 5 5 4 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?2 

WHICH ?1 

WHICH ?5 

VOU HAVE A 5 5 5 5 3 

HOW DO VOU WANT THIS ROUND SCORED ?FOUR OF A KIND 

DAVE VOU GET A SCORE OF 23 FOR THIS ROUND 



KEN'S TURN 

VOU HAVE A 6 4 3 2 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?8 

HOW DO VOU WANT THIS ROUND SCORED ?SM. STRAIGHT 

KEN VOU GET A SCORE OF 38 FOR THIS ROUND 



DAVE HAS 88 
KEN HAS 34 



POINTS 
POINTS 



DAVE'S TURN 

VOU HAVE A 6 5 3 2 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?1 

VOU HAVE A 5 5 3 2 1 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?1 

VOU HAVE A 5 5 3 2 1 

HOW DO VOU WANT THIS ROUND SCORED ?FIVES 

DAVE VOU GET A SCORE OF 1© FOR THIS ROUND 



DAVE HAS 182 POINTS 
KEN HAS 163 POINTS 



DAVE'S TURN 

VOU HAVE A 6 4 4 3 2 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?2 

WHICH ?1 

WHICH ?2 

VOU HAVE A 6 4 3 3 2 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?2 

WHICH ?1 

WHICH ?3 

VOU HAVE A 4 3 2 2 2 

HOW DO VOU WANT THIS ROUND SCORED ?SM. STRAIGHT 

DAVE VOU GET A SCORE OF 38 FOR THIS ROUND 



KEN'S TURN 

VOU HAVE A 6 4 4 1 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?3 

WHICH ?1 

WHICH ?4 

WHICH ?5 

VOU HAVE A 5 4 4 2 1 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?3 

WHICH ?1 

WHICH ?4 

WHICH ?5 

VOU HAVE A 5 4 4 4 3 

HOW DO VOU WANT THIS ROUND SCORED ?ZERO 

WHAT DO VOU WANT TO ZERO ?VAHTZEE 

KEN VOU GET A SCORE OF 8 FOR THIS ROUND 

DAVE HAS 212 POINTS 
KEN HAS 163 POINTS 



KEN'S TURN 

VOU HAVE A 5 4 3 2 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?© 

HOW DO VOU WANT THIS ROUND SCORED ?LG. STRAIGHT 

KEN VOU GET A SCORE OF 48 FOR THIS ROUND 

DAVE HAS 98 POINTS 
KEN HAS 74 POINTS 



DftVE'S TURN 

VOU HAVE A 6 6 3 3 2 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?5 

VOU HAVE A 6 6 4 3 3 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?1 

WHICH ?3 

VOU HAVE A 6 6 5 3 3 

HOW DO VOU WANT THIS ROUND SCORED ?SIXES 

DAVE VOU GET A SCORE OF 12 FOR THIS ROUND 



KEN'S TURN 

VOU HAVE A 6 5 3 2 2 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?3 

WHICH ?1 

WHICH2 ? 

WHICH ?3 

VOU HAVE A 6 6 4 2 2 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?3 

WHICH ?3 

WHICH ?4 

WHICH ?5 

VOU HAVE A 6 6 6 4 3 

HOW DO VOU WANT THIS ROUND SCORED ?SIXES 

KEN VOU GET A SCORE OF 18 FOR THIS ROUND 

DAVE HAS 11© POINTS 
KEN HAS 92 POINTS 



DAVE'S TURN 

VOU HAVE A 5 4 3 1 1 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?3 

WHICH ?1 

WHICH ?2 

WHICH ?3 

VOU HAVE A 5 2 1 1 1 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?2 

WHICH ?1 

WHICH ?2 

VOU HAVE A 4 3 1 1 1 

HOW DO VOU WANT THIS ROUND SCORED ?ZERO 

WHAT DO VOU WANT TO ZERO 7VAHTZEE 

DAVE VOU GET A SCORE OF 8 FOR THIS ROUND 



KEN'S TURN 

VOU HAVE A 6 6 5 4 2 

THIS IS VOUR 2ND OF 3 ROLLS, 

HOW MANV DO VOU WANT TO CHANGE ?3 

WHICH ?3 

WHICH ?4 

WHICH ?5 

VOU HAVE A 6 6 6 4 2 

THIS IS VOUR LAST ROLL, 

HOW MANV DO VOU WANT TO CHANGE ?2 

WHICH ?4 

WHICH ?5 

VOU HAVE A 6 6 6 5 2 

HOW DO VOU WANT THIS ROUND SCORED ?ZERO 

WHAT DO VOU WANT TO ZERO ?FOUR OF A KIND 

KEN VOU GET A SCORE OF 8 FOR THIS ROUND 

DAVE HAS 212 POINTS 
KEN HAS 163 POINTS 
THE GAME IS OVER. 

THE WINNER IS DAVE WITH 212 POINTS. 
OTHER FINAL SCORES ARE: 
DAVE FINISHES WITH 212 POINTS. 
KEN FINISHES WITH 163 POINTS. 



242 



ZOOP 



BASIC PROGRAMMER'S NIGHTMARE 

Description 

ZOOP is designed to imitate the system commands of a BASIC 
compiler # however, it gives totally meaningless and frustrating 
results. For example, to the command: 

CAT 

ZOOP responds with: 

TRY MONTGOMERY WARD ' S 

To the command : 

SCRATCH 

ZOOP responds with: 

GOT AN ITCH? 

Computer Limitations 

The version of ZOOP printed here was written for DIGITAL 
Edusys terns 15/30/35 and immediately decodes the first two 
characters input and carries on from there. It is a simple 
matter to convert ZOOP to a system which has string handling, 
however, it was felt that this version is more creative. It 
also happens to be the original. 

Program Author 

Tom Kloos 

Oregon Museum of Science and Industry 

Portland, Oregon 97200 

100PRINT\PRINT"READY"\PRINT 

110 INPUT SAWF A"253 THEN 300UNPUT S6WF B»253 THEN 300 

120LETK»10*A*B 

130IPK<>2313THEN140\PRINT«N NO FILE YOU 8OOB"VGOTO100 

140IFK<>2143THEN1S0\PRINT M TALOG TRY MONTGOMERY WARD'S«\GOTO10PI 

150IFK<>2241THENlb0\PRlNT' , STNH I DON'T PEEL LIKE IT"\GQTO100 

160IFK<>2257THEN170\PRINT«W YES I'M QUITE NEW"\GQTOi00 

170IFK<>2274THEN190\PRINT»D I'M NOT THAT OLD, BUT I'M OLD ENOUGHJM" 

180GOTO100 

l90lFK<>2297THEN2i0\PRlNT«NAME WHY? I LIKE MY NAME"\GOTO100 

200IFK<>207THEN210\PRINT«NAME WHYt I LIKE MY NAME"\GOTO100 

210IFK<>2157THEN220\PRINT"BUG GET A CAN OF RAID"\GOTQ100 

220IFK<>2322THEN230\PRINT»'OP THE FUN IS JUST STARTING"\GOTO100 

230IFK<>2303THEN240\PRINT"VE I DON'T LIKE BANKS«\GOTO100 

240IFK«>233bTHEN250SPRlNT"SAVE O.K., THE WHOLE DEC TAPE"VCHAIN "ZOOP " 

250IFK<>2305THEN260\PRINT«RATCH GOT AN ITCH?'«SGOTO100 

260IFK<»2166THEN270NPRINT"IT THIS IS NO NEWSPAPER M \GOTO100 

270 INPUT SCMF C»253 THEN 300 

280IFC<M41THEN270 

290PRINT\PRINT"WHAT??"VGOTO100 

300 PRINT "WIPED OUT COMPLETELY 11 J" 

310 CHAIN "DEMON " 

320END 

243 



Appendices 



245 





!]' 




APPENDIX A 






1 
f! 




FAMILIES OF GAMES 






ij Number or Letter 


Loqic 


Space 




[| Guessinq 
f| 1. GUESS 
i 2. HI-LO 




AWAR1 


ORBIT 






BAGLES 


ROCKET, ROCKT1, ROCKT2 






BULCOW 


SPACWR 




3. LETTER 




CHOMP 


TARGET 


i 


; 4. TRAP 




CUBE 




] 5 . STARS 




FIPFOP 


CAI, Quiz 


I 






HI-Q 


CHEMST 


> 


Piles of Obi 


ects 


1CHECK 


CHIEF 


' 


1. 23MTCH 




QUBIC 


HELLO 


1 


2 . BATNUM 




QUEEN 


KINEMA 


1 


3. EVEN 




REVRSE 


LITQZ 


1 


4. NIM 
Matrix 




TICTAC 
TOWER 


MATHD1 
TRAIN 


';'.'■ j 


BATTLE 




Casino, Gamblinq, 


War 


fJ 


HURKLE 




Bettinq 


BOAT 


;■: ! 


MUGWMP 




BINGO 


BOMBER 


; 'i 


PIZZA 




BLKJAK, BLKJAC 


GUNNER, GUNER1 




SALVO 




CRAPS 




;: 


SALVOl 




DOGS 
HORSES 


Word 
BUZZWD 


M 


Cybernetics 


(Artificial 


POKER 


HANG 


y\ 


Intel liqence 


). 


ROULET 


SYNONM 


I 


ANIMAL 
DIGITS 




SLOTS 


WORD 


h 

tj 


EVEN1 




Card and Board 


Dates 


f 1 


HEX 




ACEYDU 
CHECKR 


CALNDR 
WEKDAY 


? I 


Land Manaqement, 


GOMOKO 




f'l 


Government, 


History 


MNOPLY 


Miscellaneous 




CIVILW 




WAR 


AMAZIN 


; 


FURS 




YAHTZE 


BUG 


■.'■J 


HMRABI 






BULL 


1' 


KING 




Sports 


CHANGE 


f 


STOCK 




BASBAL 
BASKET 


DICE 
LIFE 




Plottinq 




BOWL 


LIFE-2* 




BOUNCE 




BOXING 


NUMBER 




BUNNY 




BULEYE 


POETRY, POET 




DIAMND 




CANAM 


ROCKS P 




SNOOPY (2) 




FOOTBL, FOTBAL 


RUSROU 




3DPLOT 




GOLF 


SPLAT 




UGLY 




HOCKEY 


ZOOP 



247 



APPENDIX B - GAME DIAGRAMS 



Grids far playing BATTLE, HURKLE , MUGWMP, and SALVO. 



10 

9 

8 

7 

6 

W5 

4 

3 

2 
1 










N 






























































































































































































i 























1 2 3 4 5 6 7 8 9 10 
S 



10 
9 
8 
7 
6 
W5 
4 



N 



0123456789 
S 



1 ' ■ ' ' I 



J L 



+ 



J I L 



+ 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
Use this scale with a compass for MUGWMP. 



Diagram for playing QUBIC. 



(1) Level 1 



Level 2 



(2) 
Row 



1 

2 
3 
4 



12 3 4 
(3) Column 



12 3 4 



Level 3 



Level 4 



12 3 4 



12 3 4 



Blanks for playing DIGITS 

1st 10 — 

2nd 10 — 

3rd 10 — 

248 



APPENDIX C 
INSTRUCTIONS TO GAME AUTHORS 



1. Programs must be complete and debugged / BASIC language only. 



2. 



3. 



4. 



5. 



6, 



7. 



8- 



Please submit: 

A. One program listing and 

B. Two sample runs the way an average person would play. 

Listing and run must be on white , un lined paper. If you have 
lined paper, turn it around to the un lined side. We 
absolutely cannot handle submittals on pink, yellow, blue 
or gray paper. Xerox, Ditto, or other copies are also 
unacceptable. Make as few folds in the output as possible. 

Listing and run must be done with a fresh black ribbon. 
Not a purple or blue ribbon and especially not a used 
ribbon. 

The Teletype type ball must be clean and produce crisp copy. 
Clean the ball with typewriter type cleaner or a stiff 
toothbrush . 

If possible, submit a paper tape of the program. Unoiled 
fan-fold tape is preferable. If you have oiled paper tape 
(as from a Teletype), fan fold it (folds are 8h" apart), 
leave at least 17" blank leader and 8%" trailer tape. 
Rolled paper tape or fan folds much greater or less than 
8h" cannot be handled on our high-speed readers and are 
unusable for making copies. Be. sure to wrap oiled paper 
tape in kitchen plastic wrap or waxed paper when you mail 
it. If you don't the oil seeps out and smears the output. 
Oil seepage has ruined any number of otherwise excellent 
submittals . 



We also have to know: 

A. Your name 

B. Complete address 

C. Telephone 

D. School affiliation 



E. Your age 

F. Computer system used 

G. Original source of program 

(if not you) 



By submitting a program, you are giving Digital Equipment 
Corp. the right to publish, reprint, distribute, or use 
your program in any other way. You will, of course, always 
be cited as the author. 



249 



BDSDDSD 



DIGITAL EQUIPMENT CORPORATION, Corporate Headquarters: Maynard, Massachusetts 01754, Telephone: (617) 897-5111 
SALES AND SERVICE OFFICES 

DOMESTIC — ARIZONA, Phoenix and Tucson • CALIFORNIA, Los Angeles, Monrovia, Oakland, Ridgecrest, San Diego, San Francisco 
(Mountain View), Santa Ana, Sunnyvale and Woodland Hills • COLORADO, Englewood • CONNECTICUT, Fairfield and Meriden • DISTRICT OF 
COLUMBIA, Washington (Latham, Md.) • FLORIDA, Orlando • GEORGIA, Atlanta • ILLINOIS, Chicago (Rolling Meadows) • INDIANA, 
Indianapolis • IOWA, Bettendorf • KENTUCKY, Louisville • LOUISIANA, Metairie (New Orleans) • MASSACHUSETTS, Marlborough and 
Vfeltham • MICHIGAN, Detroit (Farmington Hills) • MINNESOTA, Minneapolis • MISSOURI, Kansas City and St. Louis • NEW HAMPSHIRE, 
Manchester • NEW JERSEY, Fairfield, Metiichen and Princeton • NEW MEXICO, Albuquerque • NEW YORK, Albany, Huntington Station, 
Manhattan, Rochester and Syracuse • NORTH CAROLINA, Durham/Chapel Hill • OHIO, Cleveland, Columbus and Dayton • OKLAHOMA, 
Tulsa • OREGON, Portland • PENNSYLVANIA, Philadelphia (Bluebell) and Pittsburgh • TENNESSEE, Knoxville • TEXAS, 
Austin, Dallas and Houston • UTAH, Salt Lake City • WASHINGTON, Bellevue • WISCONSIN, Milwaukee (Brookfield) • 
INTERNATIONAL - ARGENTINA, Buenos Aires • AUSTRALIA, Adelaide, Brisbane, Canberra, Melbourne, Perth and Sydney • AUSTRIA, 
Vienna • BELGIUM, Brussels • BOLIVIA, La Paz • BRAZIL, Puerto Alegre, Rio de Janeiro and Sao Paulo • CANADA, Calgary, Halifax, Montreal 
Ottawa, Toronto and Vancouver •CHILE, Santiago* DENMARK, Coperihagen* FINLAND, Helsinki • FRANCE, Grenoble and Paris • GERMANY, 
Berlin, Cologne, Hannover, Frankfurt, Munich and Stuttgart • HONG KONG •INDIA, Bombay • INDONESIA, Djakarta • ISRAEL, Tel Aviv 

• ITALY, Milan and Turin • JAPAN, Osaka and Tokyo • MALAYSIA, Kuala Lumpur • MEXICO, Mexico City • NETHERLANDS, The Hague 

• NEW ZEALAND, Auckland • NORWAY, Oslo • PHILIPPINES, Manila • PUERTO RICO, Santurce • SINGAPORE • SPAIN, Barcelona 
and Madrid • SWEDEN, Stockholm • SWITZERLAND, Geneva and Zurich • TAIWAN, Taipei and Taoyuan • UNITED 
KINGDOM, Birmingham, Bristol, Dublin, Edinburgh, Leeds, London, Manchester and Reading • VENEZUELA, Caracas •